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?
This commit is contained in:
toonn 2021-04-19 20:44:10 +02:00
parent 7da313e10a
commit 3b8782a806
No known key found for this signature in database
GPG Key ID: A1756943D328A924

View File

@ -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";