Skip to content

Fix CLANG_BOOTSTRAP_TARGETS in Release.cmake #106407

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
Sep 5, 2024
Merged

Conversation

kwk
Copy link
Contributor

@kwk kwk commented Aug 28, 2024

Problem

Before this patch you could not build the stage2-LLVM for example because you first had to manually add it to CLANG_BOOTSTRAP_TARGETS in the Release.cmake and also add it to LLVM_RELEASE_FINAL_STAGE_TARGETS in the cmake configure run. Now you can just use -DLLVM_RELEASE_FINAL_STAGE_TARGETS="LLVM;clang" on the cmake CLI and be able to build the targets stage2-LLVM and stage2-clang without further changes to the cache file.

Solution

Take all LLVM_RELEASE_FINAL_STAGE_TARGETS elements and append them prefixed with stage2- to CLANG_BOOTSTRAP_TARGETS. Afterwards all duplicates are removed.

@kwk kwk requested a review from tstellar August 28, 2024 15:25
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Aug 28, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 28, 2024

@llvm/pr-subscribers-clang

Author: Konrad Kleine (kwk)

Changes

Take all LLVM_RELEASE_FINAL_STAGE_TARGETS elements and append them prefixed with stage2- to CLANG_BOOTSTRAP_TARGETS.


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

1 Files Affected:

  • (modified) clang/cmake/caches/Release.cmake (+4)
diff --git a/clang/cmake/caches/Release.cmake b/clang/cmake/caches/Release.cmake
index e5161dd9a27b96..4354a243f51e4e 100644
--- a/clang/cmake/caches/Release.cmake
+++ b/clang/cmake/caches/Release.cmake
@@ -68,6 +68,10 @@ if (LLVM_RELEASE_ENABLE_PGO)
   set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE STRING "")
   set(BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt" CACHE STRING "")
   set(BOOTSTRAP_LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
+  foreach(X IN LISTS LLVM_RELEASE_FINAL_STAGE_TARGETS)
+    list(APPEND CLANG_BOOTSTRAP_TARGETS "stage2-${X}")
+  endforeach()
+  list(REMOVE_DUPLICATES CLANG_BOOTSTRAP_TARGETS)
 
 else()
   if (LLVM_RELEASE_ENABLE_LTO)

@kwk kwk marked this pull request as draft August 28, 2024 15:34
@kwk kwk force-pushed the fix-release-cache branch from 8abe54c to ca503d0 Compare September 3, 2024 21:07
@kwk kwk marked this pull request as ready for review September 3, 2024 21:08
Take all `LLVM_RELEASE_FINAL_STAGE_TARGETS` elements and append them prefixed
with `stage2-` to `CLANG_BOOTSTRAP_TARGETS`.
@kwk kwk force-pushed the fix-release-cache branch from 2c1b70b to f64a72d Compare September 4, 2024 10:37
@kwk kwk requested review from nikic and removed request for tstellar and nikic September 5, 2024 07:51
@kwk kwk merged commit b206bf0 into llvm:main Sep 5, 2024
8 checks passed
@kwk kwk deleted the fix-release-cache branch September 5, 2024 08:41
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.

2 participants