Skip to content

Conversation

tstellar
Copy link
Collaborator

I uncovered this problem while trying to build release binaries on Windows with PGO.

I uncovered this problem while trying to build release binaries on
Windows with PGO.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2025

@llvm/pr-subscribers-clang

Author: Tom Stellard (tstellar)

Changes

I 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:

  • (modified) clang/utils/perf-training/lit.site.cfg.in (+2-1)
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@

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a 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?

@tstellar
Copy link
Collaborator Author

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.

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a 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.

Copy link
Member

@petrhosek petrhosek left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants