Skip to content

Use LLVM 20 throughout the Linux build - #741

Merged
wasabii merged 2 commits into
mainfrom
ci/fix-llvm-path
Aug 21, 2026
Merged

Use LLVM 20 throughout the Linux build#741
wasabii merged 2 commits into
mainfrom
ci/fix-llvm-path

Conversation

@wasabii

@wasabii wasabii commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Makes the Linux build use LLVM 20 throughout, instead of depending on whichever LLVM the runner image happens to ship.

What was there

sudo apt-get install -y clang-20 llvm-20 && \
echo "PATH=/usr/lib/llvm-18/bin:$PATH" >> $GITHUB_ENV

Install 20, then put 18 on PATH.

What I got wrong first

My initial reading was that the llvm-18 entry was dead, since nothing installs llvm-18. CI disagreed immediately — changing it to llvm-20 broke the build with:

error : unable to execute command: Executable "lld-link" doesn't exist!
error : invalid linker name in argument '-fuse-ld=lld'

which is the same failure that was blocking #716 at the start of this work.

The runner image ships its own LLVM 18, and /usr/lib/llvm-18/bin was supplying lld. The entry was not dead — it was the only thing providing a linker. The apt llvm-20 package does not include lld; that lives in a separate lld-20.

What this does

sudo apt-get install -y clang-20 llvm-20 lld-20 && \
echo "PATH=/usr/lib/llvm-20/bin:$PATH" >> $GITHUB_ENV

Every toolchain reference in the workflow is now on 20:

installed clang-20, llvm-20, lld-20
PATH /usr/lib/llvm-20/bin
ClangToolExe /usr/bin/clang-20 (already)
LlvmArToolExe /usr/bin/llvm-ar-20 (already)

-fuse-ld=lld comes from IKVM.Clang.Sdk rather than this repo, so it resolves lld off PATH — which is why the version there matters.

Why it is worth doing

The build was silently linking with LLVM 18's lld while compiling with clang 20. It worked, but only because the image happened to carry a matching-enough LLVM. That is what made the original lld-link failure so hard to place: the dependency was on the image, not on anything the workflow declared.

The build installs clang-20 and llvm-20, then puts /usr/lib/llvm-18/bin on
PATH. Nothing installs llvm-18, so that directory does not exist and the
entry does nothing.

It has been harmless so far because the two tools the build cares about are
passed by absolute path, /p:ClangToolExe=/usr/bin/clang-20 and
/p:LlvmArToolExe=/usr/bin/llvm-ar-20. Anything resolved by name off PATH
would miss the LLVM 20 binaries entirely and fall back to whatever the image
happens to provide.

develop already reads llvm-20 here, so this looks like a version bump that
updated the install line and missed the one below it.
The first commit on this branch called the llvm-18 entry on PATH dead,
because nothing installs llvm-18. CI disagreed, and the build failed with

  error : unable to execute command: Executable "lld-link" doesn't exist!
  error : invalid linker name in argument '-fuse-ld=lld'

which is the same failure that was blocking #716 back at the start of all
this. The runner image ships LLVM 18 of its own, and that directory was
supplying lld. The entry was not dead, it was the only thing providing a
linker.

The apt llvm-20 package does not include lld; that lives in a separate
lld-20. So installing it makes LLVM 20 self sufficient and lets the PATH
entry point at the version the build actually uses.

Afterwards every toolchain reference in the workflow is on 20: clang-20,
llvm-20 and lld-20 installed, /usr/lib/llvm-20/bin on PATH, and
ClangToolExe and LlvmArToolExe already pointing at the 20 binaries. Nothing
now depends on whichever LLVM the runner image happens to carry, which is
what made this fragile in the first place.
@wasabii wasabii changed the title Point PATH at the LLVM that actually gets installed Use LLVM 20 throughout the Linux build Aug 19, 2026
@wasabii
wasabii merged commit e3eab24 into main Aug 21, 2026
196 of 200 checks passed
@wasabii
wasabii deleted the ci/fix-llvm-path branch August 21, 2026 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant