Commit ecc1ec2c authored by Alyssa Ross's avatar Alyssa Ross
Browse files

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.
parent 10faf333
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ let

      systemPlatform = platformMap.${pkgs.stdenv.hostPlatform.system} or (throw "scudo not supported on ${pkgs.stdenv.hostPlatform.system}");
    in {
      libPath = "${pkgs.llvmPackages_latest.compiler-rt}/lib/linux/libclang_rt.scudo-${systemPlatform}.so";
      libPath = "${pkgs.llvmPackages_14.compiler-rt}/lib/linux/libclang_rt.scudo-${systemPlatform}.so";
      description = ''
        A user-mode allocator based on LLVM Sanitizer’s CombinedAllocator,
        which aims at providing additional mitigations against heap based
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ let
  # Well, we _can_ cross-compile from Linux :)
  hello = pkgs.runCommand "hello" {
    sdk = "${pkgs.darling.sdk}/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk";
    nativeBuildInputs = with pkgs.llvmPackages_latest; [ clang-unwrapped lld ];
    nativeBuildInputs = with pkgs.llvmPackages_14; [ clang-unwrapped lld ];
    src = pkgs.writeText "hello.c" ''
      #include <stdio.h>
      int main() {
+0 −5
Original line number Diff line number Diff line
@@ -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;
    };
+1 −1
Original line number Diff line number Diff line
@@ -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.
+1 −0
Original line number Diff line number Diff line
@@ -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;
Loading