From 37ab182939cec417531cabde136292533d45247b Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 4 Aug 2026 12:11:31 -0400 Subject: [PATCH] ci(gc): consume the setup-llvm22 action's LLVM 22 pair in RS4GC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The native-roots-rs4gc job re-discovered opt by hand and could resolve an unversioned /usr/bin/opt, then install the distro's LLVM 18 — both binaries present, the same-directory pair-check passing, and RS4GC running opt 18 over IR from Perry's linked LLVM 22 (a green gate on the wrong LLVM). Consume the matched LLVM 22 opt+clang pair the setup-llvm22 action installs and verifies under $LLVM_SYS_221_PREFIX instead, dropping the hand-discovery and its generic llvm/clang fallback. --- .github/workflows/gc-native-roots.yml | 17 +++++++---------- changelog.d/7384-rs4gc-llvm22-prefix.md | 1 + 2 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 changelog.d/7384-rs4gc-llvm22-prefix.md diff --git a/.github/workflows/gc-native-roots.yml b/.github/workflows/gc-native-roots.yml index bbc352c5de..880e15e494 100644 --- a/.github/workflows/gc-native-roots.yml +++ b/.github/workflows/gc-native-roots.yml @@ -204,16 +204,13 @@ jobs: fi llvm_bin="$llvm_root/bin" else - # Ubuntu ships a matched opt+clang pair; take the newest present, - # and install one only if the image has none. - llvm_bin="$(dirname "$(command -v opt || true)")" - if [ ! -x "$llvm_bin/opt" ]; then - llvm_bin="$(ls -d /usr/lib/llvm-*/bin 2>/dev/null | sort -V | tail -1 || true)" - fi - if [ ! -x "$llvm_bin/opt" ]; then - sudo apt-get update -qq && sudo apt-get install -y -qq llvm clang - llvm_bin="$(dirname "$(command -v opt)")" - fi + # The setup-llvm22 action (uses: above) installs, co-locates, and + # verifies the matched LLVM 22 opt+clang pair under + # $LLVM_SYS_221_PREFIX. Consume that prefix directly — hand-rediscovery + # could resolve an unversioned /usr/bin/opt and run RS4GC on the + # distro's LLVM 18, a green gate on the wrong LLVM. The pair-check + # below stays as the assertion. + llvm_bin="${LLVM_SYS_221_PREFIX:-/usr/lib/llvm-22}/bin" fi if [ ! -x "$llvm_bin/opt$exe" ] || [ ! -x "$llvm_bin/clang$exe" ]; then echo "::error::no matched opt+clang pair under $llvm_bin — RS4GC cannot run, and silently skipping it is exactly the gate that cannot fail" diff --git a/changelog.d/7384-rs4gc-llvm22-prefix.md b/changelog.d/7384-rs4gc-llvm22-prefix.md new file mode 100644 index 0000000000..2e7ef01a6b --- /dev/null +++ b/changelog.d/7384-rs4gc-llvm22-prefix.md @@ -0,0 +1 @@ +Fix the `native-roots-rs4gc` job's Linux LLVM discovery. It now consumes the matched LLVM 22 opt+clang pair that the `setup-llvm22` action installs and verifies under `$LLVM_SYS_221_PREFIX/bin`, instead of re-discovering `opt` by hand — which on `ubuntu-24.04-arm` could resolve an unversioned `/usr/bin/opt` and then install the distro's LLVM 18, passing the same-directory pair-check while running `opt` 18 over IR from Perry's linked LLVM 22 (a green gate on the wrong LLVM). The generic `llvm clang` fallback is removed along with the hand-discovery it lived in.