-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[clang][perf-training] Fix training when path to cmake has spaces in it #162919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I uncovered this problem while trying to build release binaries on Windows with PGO.
@llvm/pr-subscribers-clang Author: Tom Stellard (tstellar) ChangesI uncovered this problem while trying to build release binaries on Windows with PGO. Full diff: https://github.com/llvm/llvm-project/pull/162919.diff 1 Files Affected:
diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in
index da81ec21a28a6..7a2f162539909 100644
--- a/clang/utils/perf-training/lit.site.cfg.in
+++ b/clang/utils/perf-training/lit.site.cfg.in
@@ -1,6 +1,7 @@
@LIT_SITE_CFG_IN_HEADER@
import sys
+import shlex
config.clang_tools_dir = lit_config.substitute("@CURRENT_TOOLS_DIR@")
config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
@@ -8,7 +9,7 @@ config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_exe = "@Python3_EXECUTABLE@"
-config.cmake_exe = "@CMAKE_COMMAND@"
+config.cmake_exe = shlex.quote("@CMAKE_COMMAND@")
config.llvm_src_dir ="@CMAKE_SOURCE_DIR@"
config.cmake_generator ="@CMAKE_GENERATOR@"
config.use_llvm_build = @CLANG_PGO_TRAINING_USE_LLVM_BUILD@
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't come up for any of the other executables/paths?
I havne't run into this problem with anything else, but then again, cmake is the only executable called from the lit tests when doing the perf training. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I havne't run into this problem with anything else, but then again, cmake is the only executable called from the lit tests when doing the perf training.
LGTM then. We could preemptively fix the other paths, but if there's no way to validate it, then probably best to leave that for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @boomanaiden154, I'm surprised that this didn't show up elsewhere and we'll need to audit other lit.site.cfg.in
files, but I'm fine merging this change to unblock you.
I uncovered this problem while trying to build release binaries on Windows with PGO.