From 3b8782a80652c02d060b91cb1001ccb8dfeb9cd8 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 19 Apr 2021 20:44:10 +0200 Subject: [PATCH] bootstrap-tools: Add bootstrapFiles argument I was having a hard time testing new bootstrapFiles because `make-bootstrap-tools.nix` imports `pkgspath` but does not pass anything but the current system. This is merely for convenience and I'm not entirely certain it's a sensible thing to do, maybe generating new bootstrapFiles while overriding the current bootstrapFiles isn't something you're supposed to do? --- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index e8a2dd640f0a..1889863ee744 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -1,10 +1,17 @@ -{ pkgspath ? ../../.., test-pkgspath ? pkgspath, system ? builtins.currentSystem, crossSystem ? null }: +{ pkgspath ? ../../.., test-pkgspath ? pkgspath +, system ? builtins.currentSystem, crossSystem ? null, bootstrapFiles ? null +}: -let - pkgs = import pkgspath ({ inherit system; } // (if (crossSystem != null) then { inherit crossSystem; } else {})); -in - -with pkgs; +let cross = if crossSystem != null + then { inherit crossSystem; } + else {}; + custom-bootstrap = if bootstrapFiles != null + then { stdenvStages = args: + let args' = args // { bootstrapFiles = bootstrapFiles; }; + in (import "${pkgspath}/pkgs/stdenv/darwin" args').stagesDarwin; + } + else {}; +in with import pkgspath ({ inherit system; } // cross // custom-bootstrap); let llvmPackageSet = if stdenv.hostPlatform.isAarch64 then "llvmPackages_11" else "llvmPackages_7";