Description
Our c-tiny and js-tiny tests use lld
, which requires a pinned rustc (LLVM_COMPATIBLE_NIGHTLY
) and LLVM that are compatible with each other.
We have existing documented policy on when MSRV and pinned Rust toolchains can be upgraded. We have no documented policy on what upgrades are allowed for the LLVM version. Updating MSRV can cascade to requiring an updated pinned Rust toolchain and LLVM version, as in #5934.
The rule we have roughly followed in the past is that an updated LLVM must be "widely available". A sufficient condition for that has been if the LLVM is available on LTS APT, GitHub Actions runners, and XCode (using this table ) This is not necessarily a necessary condition, however, and we should have one documented.
XCode does a major update only once a year and their latest version (from September) uses LLVM 17, whereas LLVM 18 has been out and in use since early 2024. Using LLVM 17 locks us to MSRVs from January: the last time I did a Rust upgrade there was a relatively narrow region of Rust versions where the Rust-LLVM coupling worked with external LLVM and we were not needing to use LLVM 18.
Personally, I do not think that the LLVM version used by software that updates once a year and does not necessarily pick up the latest LLVM from 6 months before its latest update is going to always be a workable upper bound for us. It has worked in the past, but such a litmus test can lead to the pinned nightly lagging behind for almost two years1. I think our MSRV policy is quite well thought out and should not be overridden by the release schedule of software that may end up putting us back on MSRVs that are more than a year and a half old.
(It's worth highlighting, these binaries are used for two FFI tests: test-c-tiny and test-js-tiny)
Here's a proposed litmus test for things that are necessary and sufficient for an LLVM version to be considered "widely available". The relevant software binaries we care about are clang, llvm, and lld: all three must be obtainable at the requested version.
- The binaries must be available on APT on the latest Ubuntu LTS
- The binaries must be available on the GitHub actions runners without adding a PPA
- The binaries must be available via XCode or
brew
. - For core ICU4X developers on corporate hardware, the binaries must be available in some normal supported way (For Googlers this amounts to "available on gLinux APT", which may lag slightly behind public APT)
- It must be possible to download and install the binaries on Windows (basically always true)
A binary not being available via XCode is dispreferred but not a blocker: if choosing between two LLVM versions that work equally well, pick the one available on latest XCode, however if the newer one enables a desired MSRV (or something else), it is fine for it to not work on XCode.
Footnotes
-
Bear in mind, Rust uses LLVM trunk, not LLVM releases, so an LLVM release's changes will be found in rustc for a fair number of months before the release. ↩