Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM CI: build LLVM from source #14573

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HertzDevil
Copy link
Contributor

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.

@oprypin
Copy link
Member

oprypin commented May 7, 2024

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

@@ -38,19 +33,30 @@ jobs:
uses: actions/cache@v4
with:
path: ./llvm
key: llvm-${{ matrix.llvm_version }}
key: llvm-libs-${{ matrix.llvm_version }}-${{ hashFiles('.github/workflows/llvm.yml') }}-linux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The hash on this workflow file triggers a rebuild every time we change anything here. This includes every time we bump the version for install-crystal action after each release. I think that's quite frequent in relation to the long build times for LLVM.
I'm wondering if we could narrow this down somehow, maybe call a separate workflow which handles only building LLVM?

@straight-shoota
Copy link
Member

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

@ysbaddaden
Copy link
Contributor

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/).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants