-
Notifications
You must be signed in to change notification settings - Fork 21
fix(ci): unify redundant LLVM cache keys #1134
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: develop
Are you sure you want to change the base?
Conversation
Recent PR runs exceeded GitHub Actions cache limits, causing LLVM to be recompiled on every workflow run. This led to hours-long turnaround times to verify changes. As a workaround, the fork workflow was being used to test the PR. This commit simplifies the cache key structure to reduce redundant cache entries: - Add `llvm-os-key` using container name or runs-on for OS versioning - Make `llvm-archive-basename` conditional based on MSan only - Transform cache keys to replace ":" with "-" for safety - Only build instrumented libc++ for MSan where it's required MSan requires all code, including libc++ to be instrumented to track initialization state correctly. ASan and UBSan can effectively catch errors without instrumenting dependencies, making custom libc++ builds low-ROI for these sanitizers. Resulting cache key structure: - MSan builds: include compiler, version, and sanitizer type (e.g., llvm-dc4cef8-release-ubuntu-24.04-clang-21-MSan) - All other builds: omit compiler info since ABI is compatible (e.g., llvm-dc4cef8-release-ubuntu-24.04) Non-sanitizer builds, ASan builds, and UBSan builds across gcc/clang versions on the same OS now share a single cache entry, as they produce ABI-compatible LLVM binaries. Fixes cppalliance#981
✨ Highlights
🧾 Changes by Scope
🔝 Top Files
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| llvm-os-key: {{#if container}}{{{ container }}}{{else}}{{{ runs-on }}}{{/if}} | ||
| llvm-archive-basename: {{#if msan}}llvm-{{{ substr llvm-hash 0 7 }}}-{{{ llvm-build-preset-prefix }}}-{{{ llvm-os-key }}}-{{{ compiler }}}-{{{ version }}}-MSan{{else}}llvm-{{{ substr llvm-hash 0 7 }}}-{{{ llvm-build-preset-prefix }}}-{{{ llvm-os-key }}}{{/if}} |
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.
Sanitizer jobs now hit non-sanitized LLVM cache
The cache basename at this change no longer differentiates compiler or sanitizer, so ASan/UBSan matrix entries now use the same cache key as unsanitized Release builds. If any non-sanitized job primes the cache first, the later sanitizer jobs see a cache hit and skip Install LLVM (condition at lines 398–400), meaning they run against a release-built LLVM/libc++ instead of the requested LLVM_USE_SANITIZER instrumented build. Sanitizer coverage for LLVM and its runtimes therefore depends on job scheduling and can silently drop whenever a release build seeds the cache.
Useful? React with 👍 / 👎.
|
An automated preview of the documentation is available at https://1134.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2025-12-17 10:12:42 UTC |
Recent PR runs exceeded GitHub Actions cache limits, causing LLVM to be recompiled on every job of the workflow run. This led to hours-long turnaround times to verify changes. As a workaround, the fork workflow was being used to test the PR.
This commit simplifies the cache key structure to reduce redundant cache entries:
llvm-os-keyusing container name or runs-on for OS versioningllvm-archive-basenameconditional based on MSan onlyMSan requires all code, including libc++ to be instrumented to track initialization state correctly. ASan and UBSan can effectively catch errors without instrumenting dependencies, making custom libc++ builds low-ROI for these sanitizers.
Resulting cache key structure:
Non-sanitizer builds, ASan builds, and UBSan builds across gcc/clang versions on the same OS now share a single cache entry, as they produce ABI-compatible LLVM binaries.
Fixes #981