fix(release): name Alpine's llvm-config by its prefix - #9348
Merged
Conversation
The musl image's LLVM version check invoked a bare `llvm-config`, which Alpine does not put on PATH -- its LLVM 22 lives under /usr/lib/llvm22 and only the versioned tools are installed. The check therefore failed during `docker build` with /bin/sh: line 0: llvm-config: not found before any Rust code was compiled, so the musl legs never got as far as exercising the fix they were added for (stage run 33443904901). The packages themselves install correctly; only the assertion was wrong. Name the prefix explicitly, and put /usr/lib/llvm22/bin on PATH so the rest of the LLVM tooling is reachable by plain name inside the image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #9298. The musl image's LLVM version check invoked a bare
llvm-config, which Alpine does not put onPATH— its LLVM 22 installs under/usr/lib/llvm22and only versioned tools are exposed. Sodocker buildfailed here:The packages install correctly — the apk run reached 76/80 before my assertion ran. Only the assertion was wrong, and it failed before any Rust was compiled, so the musl legs never got as far as exercising the fix they were added for (stage run 33443904901).
Two changes:
/usr/lib/llvm22/bin/llvm-config.build_linux_musl.shalready did this correctly via$LLVM_SYS_221_PREFIX/bin/llvm-config; only the Dockerfile used the bare name./usr/lib/llvm22/binonPATHso the rest of the LLVM tooling is reachable by plain name inside the image.The failure message is also improved to print what
llvm-configactually reported, rather than re-running a command that just failed to resolve.Worth noting the guard did its job in one respect: it caught the mismatch at image-build time rather than letting the build proceed and fail at the final link, which is the failure this whole container exists to avoid.