From 887d33a089c556592b789a7699019babf8aa2402 Mon Sep 17 00:00:00 2001 From: toonn Date: Sun, 12 Nov 2023 05:52:30 -0800 Subject: [PATCH 1/2] freshBootstrapTools: Overlay the package set with the desired LLVM As reported in #241692, since the `llvmPackages` bump the bootstrap-tools started failing to build due to a mismatch in LLVM versions used to build certain tools. By overlaying the imported package set to specify `llvmPackages`, we get everything built with the expected LLVM version. --- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index 448d6ecd9f179..b51b5fdb34bcc 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -1,5 +1,8 @@ { pkgspath ? ../../.., test-pkgspath ? pkgspath , localSystem ? { system = builtins.currentSystem; } +# Specify the desired LLVM version in an overlay to avoid the use of +# mismatching versions. +, overlays ? [(self: super: { llvmPackages = super.llvmPackages_11; })] , crossSystem ? null , bootstrapFiles ? null }: @@ -13,11 +16,9 @@ let cross = if crossSystem != null in (import "${pkgspath}/pkgs/stdenv/darwin" args'); } else {}; -in with import pkgspath ({ inherit localSystem; } // cross // custom-bootstrap); +in with import pkgspath ({ inherit localSystem overlays; } // cross // custom-bootstrap); -let - llvmPackages = llvmPackages_11; -in rec { +rec { coreutils_ = coreutils.override (args: { # We want coreutils without ACL support. aclSupport = false; From 985ff1cb889d5a438c6812ed827f375c1ee92b99 Mon Sep 17 00:00:00 2001 From: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com> Date: Fri, 17 Nov 2023 08:26:41 +0000 Subject: [PATCH 2/2] Update pkgs/stdenv/darwin/make-bootstrap-tools.nix --- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index b51b5fdb34bcc..5be6e2a4e6e26 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -2,6 +2,19 @@ , localSystem ? { system = builtins.currentSystem; } # Specify the desired LLVM version in an overlay to avoid the use of # mismatching versions. +# +# The llvmPackages that we take things (clang, libc++ and such) from +# is specified explicitly to be llvmPackages_11 to keep the +# bootstrap-tools stable. However, tools like otool, +# install_name_tool and strip are taken straight from stdenv.cc, +# which, after the bump, is a different LLVM version altogether. +# +# The original intent was that bootstrap-tools specified LLVM 11 +# exhaustively but it didn't. That should be rectified with this +# PR. As to why stick with 11? That's just to keep the +# bootstrap-tools unchanged. +# +# https://github.com/NixOS/nixpkgs/pull/267058/files#r1390889848 , overlays ? [(self: super: { llvmPackages = super.llvmPackages_11; })] , crossSystem ? null , bootstrapFiles ? null