crystal
crystal copied to clipboard
LLVM CI: build LLVM from source
The official Apt repositories only serve the 3 most recent major versions, while the volunteer-built packages are incomplete and of inconsistent quality, so the best solution is to build LLVM ourselves.
This also reduces the total size for the 6 LLVM caches from 8 GB to around 2.4 GB. That's more than half the limit for a GitHub repository.
lld
is needed for #13193; technically speaking, we could build it straight from the very repository we're cloning here, but we aren't really testing any version-specific lld
behavior, so this patch grabs it from Apt.
This also reduces the total size for the 6 LLVM caches
Hmm actually it looks like there wasn't even any reason to have those caches before because it just moves the download+extract step from one place on GitHub to another. Now of course they'll be necessary. Looks good
I was actually about to look into using nix
more for our builds.
We already have an environment with configurable LLVM versions in shell.nix
. The dependencies are defined and cached in nixpkgs. And nixpkgs_unstable
currently has package definitions for LLVM 8 through LLVM 18. So we don't need to build anything ourselves
The official Apt repositories only serve the 3 most recent major versions
You mean the official Debian or Ubuntu APT repositories?
Because the official LLVM APT repositories have all the releases we want. For example LLVM 13 to 18 for Ubuntu 22.04 + nightlies of LLVM 19 (see https://apt.llvm.org/jammy/pool/main/l/), and it will continue to receive the new releases for years to come. For Ubuntu 20.04 they have all releases since LLVM 9 (see https://apt.llvm.org/focal/pool/main/l/).
Noble, the next Ubuntu version that is going to become LTS, serves only 17 and beyond, so we risk being unable to update to a more recent Ubuntu runner image. We cannot really drop CI for LLVM 13 yet, and technically all the way down to LLVM 11, the most recent version released when Crystal 1.0 was out.
Also I don't think there is really a reason to switch to nightlies. The stable source releases are good enough.