Skip to content

Commit

Permalink
llvmPackages: unify version for all platforms but Darwin
Browse files Browse the repository at this point in the history
Currently, every platform uses LLVM 18 except for the following
exceptions:

* Darwin, on LLVM 16.
* WASM, on LLVM 16.
* Android, on LLVM 12.

As discussed with RossComputerGuy and alyssais on Matrix, we plan to
bump both Darwin and Linux to LLVM 19 after the 24.11 branch‐off,
and try to keep them in sync after that, bumping to new stable LLVM
releases immediately after releases branch off.

This prepares for a 25.05 where `llvmPackages` is a simple
platform‐independent alias by removing all the redundant branches
and upgrading WASM and Android to LLVM 18.

I checked with lilyinstarlight who did the previous LLVM bump for
WASM and she confirmed that there should be no particular reason to
keep it pinned to 16 so long as Firefox continues to compile, and I
have confirmed that it does.

Android was last bumped back when the other platforms
were on LLVM 7, which is pretty good evidence that these
platform‐specific conditionals create unnecessary divergence
and bitrot quickly. Due to the “maximum‐of‐minimums”
cross‐compilation logic, it was inevitably picking LLVM 16 or 18
anyway. `pkgsCross.aarch64-android.hello` fails the exact same way
as it does on `master` on all the platforms I tested (compiler-rt
failing to build on `aarch64-linux` and `x86_64-linux`, and the Linux
headers package expecting `gcc(1)` on `aarch64-darwin`).

I’m not entirely sure that the maximum‐of‐minimums logic is
correct (should it be completely ignoring `buildPlatform` like this?),
but since it will hopefully go away very soon I’ve decided not to
spend more time thinking about it.
  • Loading branch information
emilazy committed Sep 20, 2024
1 parent d0b8a0b commit bb7c7d6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15422,18 +15422,12 @@ with pkgs;
libllvm = llvmPackages.libllvm;
llvm-manpages = llvmPackages.llvm-manpages;

# Please remove all this logic when bumping to LLVM 19 and make this
# a simple alias.
llvmPackages = let
# This returns the minimum supported version for the platform. The
# assumption is that or any later version is good.
choose = platform:
/**/ if platform.isDarwin then 16
else if platform.isFreeBSD then 18
else if platform.isOpenBSD then 18
else if platform.isAndroid then 12
else if platform.isLinux then 18
else if platform.isWasm then 16
# For unknown systems, assume the latest version is required.
else 18;
choose = platform: if platform.isDarwin then 16 else 18;
# We take the "max of the mins". Why? Since those are lower bounds of the
# supported version set, this is like intersecting those sets and then
# taking the min bound of that.
Expand Down

0 comments on commit bb7c7d6

Please sign in to comment.