Setup LLVM

.github/actions/setup-llvm/action.yml

Source: .github/actions/setup-llvm/action.yml · composite action

Install and select clang/lld compatible with the active Rust compiler's LLVM major.

Intended for: Kept for callers of their own: StroggForge's compiling jobs install LLVM through rust-setup, or Corprus Crucible, which run the same setup-llvm.sh.

Release behavior#

Toolchain setup only; produces no release. Migration across consumers is tracked separately from this configuration.

Artifacts and effects#

  • Compiler/linker environment for subsequent Cargo commands

Assumptions and permissions#

  • Run after dtolnay/rust-toolchain; pass the MSRV toolchain for older compiler checks.
  • Ubuntu uses apt.llvm.org; macOS uses LLVM's release archive on ARM64 and conda-forge on Intel (always its nocfg builds, which link the system's libraries); Windows and apt-less Linux use release archives; EL9 uses dnf/stream packages.
  • Matching a major is policy; LLVM 22.1.8 is a measured reference, not an unconditional patch pin.

Failure modes#

  • Stream clang or lld differs from rustc LLVM: fail loudly and inspect package availability.
  • l3i requires clang, lld and cross-language LTO flags together; a compiler binary alone is insufficient.

Example#

Use rust-setup in a compiling job. For platform exceptions see toolchains.

Inputs#

NameTypeRequiredDefaultDescription
llvm_version—falseFull LLVM release to install instead of the one rustc reports, e.g. 22.1.8.
toolchain—falseRust toolchain whose LLVM major to match (a rustup name such as '1.88' or 'stable'). Empty uses the default rustc.

Outputs#

NameTypeRequiredDefaultDescription
llvm_major——${{ steps.llvm.outputs.llvm_major }}The LLVM major installed.
llvm_version——${{ steps.llvm.outputs.llvm_version }}The clang version installed.

Permissions#

Top-level: —. Undeclared means inherited from the caller, not "none needed".

Steps#

Composite action#

StepAction / commandCondition
Install LLVM matching rustcbash "${{ github.action_path }}/../../../scripts/shared/setup-llvm.sh" "${{ inputs.toolchain }}" "${{ inputs.llvm_version }}"—