From ecc1ec2c72a2e46a3ba19fd150009ea9cfc9d8c7 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 4 May 2023 08:39:50 +0000 Subject: llvmPackages_latest: move to aliases.nix Because llvmPackages_latest is used in Nixpkgs, by quite a few packages, it's difficult to keep it up to date, because updating it requires some level of confidence that every package that uses it is going to keep working after the update. The result of this is that llvmPackages_latest is not updated, and so we end up in the situation that "latest" is two versions older than the latest version we actually provide. This is confusing and unexpected. "But won't this end up fragmenting our LLVM versions, if every package previously using _latest is separately pinned to LLVM 14?", I hear you ask. No. That fragmentation is already happening, even with an llvmPackages_latest, because packages that actually require the _latest_ version of LLVM (15/16), have already been decoupled from llvmPackages_latest since it hasn't been upgraded. So like it or not, we can't escape packages depending on specific recent LLVMs. The only real fix is to get better at keeping the default LLVM up to date (which I'm reasonably confident we're getting into a better position to be feasibly better able to do). So, unless we want to double down on providing a confusingly named "llvmPackages_latest" attribute that refers to some arbitrary LLVM version that's probably not the latest one (or even the latest one available in Nixpkgs), we only have two options here: either we don't provide such an attribute at all, or we don't use it in Nixpkgs so we don't become scared to bump it as soon as we have a new LLVM available. --- .../terminal-emulators/foot/default.nix | 5 ---- pkgs/os-specific/linux/keyutils/default.nix | 2 +- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 30 ++++++++++------------ 4 files changed, 15 insertions(+), 23 deletions(-) (limited to 'pkgs') diff --git a/pkgs/applications/terminal-emulators/foot/default.nix b/pkgs/applications/terminal-emulators/foot/default.nix index 02de89a1b7a73..b2b3526951a4c 100644 --- a/pkgs/applications/terminal-emulators/foot/default.nix +++ b/pkgs/applications/terminal-emulators/foot/default.nix @@ -23,7 +23,6 @@ # for clang stdenv check , foot , llvmPackages -, llvmPackages_latest }: let @@ -187,10 +186,6 @@ stdenv.mkDerivation rec { inherit (llvmPackages) stdenv; }; - clang-latest-compilation = foot.override { - inherit (llvmPackages_latest) stdenv; - }; - noPgo = foot.override { allowPgo = false; }; diff --git a/pkgs/os-specific/linux/keyutils/default.nix b/pkgs/os-specific/linux/keyutils/default.nix index 54622253ed27c..86b2535e1dde3 100644 --- a/pkgs/os-specific/linux/keyutils/default.nix +++ b/pkgs/os-specific/linux/keyutils/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { ./conf-symlink.patch # This patch solves a duplicate symbol error when building with a clang stdenv # Before removing this patch, please ensure the package still builds by running eg. - # nix-build -E 'with import ./. {}; pkgs.keyutils.override { stdenv = pkgs.llvmPackages_latest.stdenv; }' + # nix-build -E 'with import ./. {}; pkgs.keyutils.override { stdenv = pkgs.clangStdenv; }' ./0001-Remove-unused-function-after_eq.patch # Fix build for s390-linux, where size_t is different from ptrdiff_t. diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 12281c39e3430..b7a1f91ebae24 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1886,6 +1886,7 @@ mapAliases ({ inherit (stdenv) buildPlatform hostPlatform targetPlatform; # Added 2023-01-09 # LLVM packages for (integration) testing that should not be used inside Nixpkgs: + llvmPackages_latest = llvmPackages_14; llvmPackages_git = recurseIntoAttrs (callPackage ../development/compilers/llvm/git { inherit (stdenvAdapters) overrideCC; buildLlvmTools = buildPackages.llvmPackages_git.tools; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index be8e7b5ed2785..9f1eab70884fe 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14505,7 +14505,7 @@ with pkgs; ciao = callPackage ../development/compilers/ciao { }; codon = callPackage ../development/compilers/codon { - inherit (llvmPackages_latest) lld stdenv; + inherit (llvmPackages_14) lld stdenv; }; colm = callPackage ../development/compilers/colm { }; @@ -14568,7 +14568,7 @@ with pkgs; clang_16 = llvmPackages_16.clang; clang-tools = callPackage ../development/tools/clang-tools { - llvmPackages = llvmPackages_latest; + llvmPackages = llvmPackages_14; }; clang-tools_5 = callPackage ../development/tools/clang-tools { @@ -14620,13 +14620,13 @@ with pkgs; }; clang-analyzer = callPackage ../development/tools/analysis/clang-analyzer { - llvmPackages = llvmPackages_latest; - inherit (llvmPackages_latest) clang; + llvmPackages = llvmPackages_14; + inherit (llvmPackages_14) clang; }; clazy = callPackage ../development/tools/analysis/clazy { - llvmPackages = llvmPackages_latest; - stdenv = llvmPackages_latest.stdenv; + llvmPackages = llvmPackages_14; + stdenv = llvmPackages_14.stdenv; }; #Use this instead of stdenv to build with clang @@ -15580,7 +15580,7 @@ with pkgs; lld_15 = llvmPackages_15.lld; lld_16 = llvmPackages_16.lld; - lldb = llvmPackages_latest.lldb; + lldb = lldb_14; lldb_5 = llvmPackages_5.lldb; lldb_6 = llvmPackages_6.lldb; lldb_7 = llvmPackages_7.lldb; @@ -15612,8 +15612,6 @@ with pkgs; llvm-manpages = llvmPackages.llvm-manpages; llvmPackages = let - latest_version = lib.toInt - (lib.versions.major llvmPackages_latest.llvm.version); # This returns the minimum supported version for the platform. The # assumption is that or any later version is good. choose = platform: @@ -15622,7 +15620,7 @@ with pkgs; else if platform.isAndroid then 12 else if platform.isLinux then 11 else if platform.isWasm then 12 - else latest_version; + else 14; # 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. @@ -15714,8 +15712,6 @@ with pkgs; targetLlvm = targetPackages.llvmPackages_16.llvm or llvmPackages_16.llvm; })); - llvmPackages_latest = llvmPackages_14; - llvmPackages_rocm = recurseIntoAttrs (callPackage ../development/compilers/llvm/rocm { }); lorri = callPackage ../tools/misc/lorri { @@ -17354,7 +17350,7 @@ with pkgs; protege-distribution = callPackage ../development/web/protege-distribution { }; umr = callPackage ../development/misc/umr { - llvmPackages = llvmPackages_latest; + llvmPackages = llvmPackages_14; }; refurb = callPackage ../development/tools/refurb { }; @@ -17437,7 +17433,7 @@ with pkgs; buf-language-server = callPackage ../development/tools/language-servers/buf-language-server { }; ccls = callPackage ../development/tools/language-servers/ccls { - llvmPackages = llvmPackages_latest; + llvmPackages = llvmPackages_14; }; docker-compose-language-service = callPackage ../development/tools/language-servers/docker-compose-language-service { }; @@ -17998,7 +17994,7 @@ with pkgs; cvise = python3Packages.callPackage ../development/tools/misc/cvise { # cvise keeps up with fresh llvm releases and supports wide version range - inherit (llvmPackages_latest) llvm libclang; + inherit (llvmPackages_14) llvm libclang; }; cwltool = callPackage ../applications/science/misc/cwltool { }; @@ -21384,7 +21380,7 @@ with pkgs; libcint = callPackage ../development/libraries/libcint { }; libclc = callPackage ../development/libraries/libclc { - llvmPackages = llvmPackages_latest; + llvmPackages = llvmPackages_14; }; libcli = callPackage ../development/libraries/libcli { }; @@ -22419,7 +22415,7 @@ with pkgs; libunwind = if stdenv.isDarwin then darwin.libunwind - else if stdenv.hostPlatform.system == "riscv32-linux" then llvmPackages_latest.libunwind + else if stdenv.hostPlatform.system == "riscv32-linux" then llvmPackages_14.libunwind else callPackage ../development/libraries/libunwind { }; libuv = callPackage ../development/libraries/libuv { -- cgit 1.4.1