-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[XRay] Run tests inside bootstrapping build #168378
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?
[XRay] Run tests inside bootstrapping build #168378
Conversation
|
@llvm/pr-subscribers-xray Author: Aiden Grossman (boomanaiden154) ChangesCOMPILER_RT_STANDALONE_BUILD is set when doing a bootstrapping build through LLVM_ENABLE_RUNTIMES with the CMake source directory being in llvm/. This patch changes the XRay tests to also detect that we have LLVM sources and the llvm-xray tool if we are in a bootstrapping build through the use of the LLVM_TREE_AVAILABLE variable which is set in runtimes/CMakeLists.txt. Full diff: https://github.com/llvm/llvm-project/pull/168378.diff 1 Files Affected:
diff --git a/compiler-rt/test/xray/lit.site.cfg.py.in b/compiler-rt/test/xray/lit.site.cfg.py.in
index 72a7be6a80e3a..4ed82beb6a2ab 100644
--- a/compiler-rt/test/xray/lit.site.cfg.py.in
+++ b/compiler-rt/test/xray/lit.site.cfg.py.in
@@ -5,7 +5,7 @@ config.name_suffix = "@XRAY_TEST_CONFIG_SUFFIX@"
config.xray_lit_source_dir = "@XRAY_LIT_SOURCE_DIR@"
config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@"
config.target_arch = "@XRAY_TEST_TARGET_ARCH@"
-config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD@" != "TRUE")
+config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD AND NOT LLVM_TREE_AVAILABLE@" != "TRUE")
# TODO: Look into whether we can run a capability test on the standalone build to
# see whether it can run 'llvm-xray convert' instead of turning off tests for a
|
047f91e to
01fe3b5
Compare
COMPILER_RT_STANDALONE_BUILD is set when doing a bootstrapping build through LLVM_ENABLE_RUNTIMES with the CMake source directory being in llvm/. This patch changes the XRay tests to also detect that we have LLVM sources and the llvm-xray tool if we are in a bootstrapping build through the use of the LLVM_TREE_AVAILABLE variable which is set in runtimes/CMakeLists.txt.
cf0909e to
944a572
Compare
🐧 Linux x64 Test Results
|
| config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@" | ||
| config.target_arch = "@XRAY_TEST_TARGET_ARCH@" | ||
| config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD@" != "TRUE") | ||
| config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD AND NOT LLVM_TREE_AVAILABLE@" != "TRUE") |
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.
Have you tested this? I wasn't aware that you can put an expression between @...@, I always assumed it has to be just @VAR@. Personally I'd prefer defining a new variable BUILT_WITH_LLVM in CMake and just using that here.
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.
Tested as far as the tests run with this. But turns out when inspecting the generated file, it just put the boolean expression in there, so this does not in fact work as intended.
I've updated the patch to use a new COMPILER_RT_BUILT_WITH_LLVM CMake variable that gets setup in the CMake config as suggested. I've validated that it does correctly set everything up.
COMPILER_RT_STANDALONE_BUILD is set when doing a bootstrapping build through LLVM_ENABLE_RUNTIMES with the CMake source directory being in llvm/. This patch changes the XRay tests to also detect that we have LLVM sources and the llvm-xray tool if we are in a bootstrapping build through the use of the LLVM_TREE_AVAILABLE variable which is set in runtimes/CMakeLists.txt.