From bb7c7d604de3765edf9dc019a29243b9da4e9a46 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 19 Sep 2024 22:37:43 +0100 Subject: [PATCH] llvmPackages: unify version for all platforms but Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pkgs/top-level/all-packages.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1254d45dda59e..0240167412f67 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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.