Skip to content

[clang][CI] Reuse build dir between C++26 and modules build of runtimes #132480

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

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

Endilll
Copy link
Contributor

@Endilll Endilll commented Mar 21, 2025

Between C++26 and Clang modules build of runtimes, which are used as an additional testing for Clang, the only difference are LIBCXX_TEST_PARAMS and LIBCXXABI_TEST_PARAMS. Both of them are transformed into actual lit configuration lines, and put into SERIALIZED_LIT_PARAMS, which end up in libcxx/test/cmake-bridge.cfg via configure_file command. Notably, it seems that they are not used in any other way.

I checked that if those variables are changed, subsequent runs of CMake configuration step regenerate cmake-bridge.cfg with the new values. Which means that we don't need to do clean builds for every runtimes configuration we want to test.

I hope that together with #131913, this will be enough to alleviate Linux CI pains we're having, and we wouldn't have to make a tough choice between C++26 and Clang modules builds for pre-merge CI.

@Endilll Endilll added infrastructure Bugs about LLVM infrastructure clang Clang issues not falling into any other category labels Mar 21, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 21, 2025

@llvm/pr-subscribers-clang

Author: Vlad Serebrennikov (Endilll)

Changes

Between C++26 and Clang modules build of runtimes, which are used as an additional testing for Clang, the only difference are LIBCXX_TEST_PARAMS and LIBCXXABI_TEST_PARAMS. Both of them are transformed into actual lit configuration lines, and put into SERIALIZED_LIT_PARAMS, which end up in libcxx/test/cmake-bridge.cfg via configure_file command. Notably, it seems that they are not used in any other way.

I checked that if those variables are changed, subsequent runs of CMake configuration step regenerate cmake-bridge.cfg with the new values. Which means that we don't need to do clean builds for every runtimes configuration we want to test.

I hope that together with #131913, this will be enough to alleviate Linux CI pains we're having, and we wouldn't have to make a tough choice between C++26 and Clang modules builds for pre-merge CI.


Full diff: https://github.com/llvm/llvm-project/pull/132480.diff

1 Files Affected:

  • (modified) .ci/monolithic-linux.sh (+5-1)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 8efca3cc6d78a..475cb5ed66c20 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -110,7 +110,11 @@ if [[ "${runtimes}" != "" ]]; then
 
   echo "--- cmake runtimes clang modules"
 
-  rm -rf "${RUNTIMES_BUILD_DIR}"
+  # We don't need to do a clean build of runtimes, because LIBCXX_TEST_PARAMS
+  # and LIBCXXABI_TEST_PARAMS only affect lit configuration, which successfully
+  # propagates without a clean build. Other that those two variables, builds
+  # are supposed to be the same.
+
   cmake -S "${MONOREPO_ROOT}/runtimes" -B "${RUNTIMES_BUILD_DIR}" -GNinja \
       -D CMAKE_C_COMPILER="${INSTALL_DIR}/bin/clang" \
       -D CMAKE_CXX_COMPILER="${INSTALL_DIR}/bin/clang++" \

@Endilll Endilll merged commit 8f863fc into llvm:main Mar 25, 2025
12 checks passed
@Endilll Endilll deleted the stop-cleaning-build-dir-for-runtimes branch March 25, 2025 15:38
Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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 infrastructure Bugs about LLVM infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants