top-level: Allow manually specifying a stdenv, and fix stdenv tests

- The darwin test can now force the use of the freshly-booted darwin stdenv
 - The linux test now passes enough dummy arguments

This may make debugging harder, if so, check out #20889
This commit is contained in:
John Ericson 2016-12-03 17:21:07 -08:00
parent 4751d9e5ad
commit 5c6234a7d3
3 changed files with 16 additions and 5 deletions

View File

@ -332,10 +332,10 @@ in rec {
};
# The ultimate test: bootstrap a whole stdenv from the tools specified above and get a package set out of it
test-pkgs = let
stdenv = import (test-pkgspath + "/pkgs/stdenv/darwin") { inherit system bootstrapFiles; };
in import test-pkgspath {
test-pkgs = import test-pkgspath {
inherit system;
bootStdenv = stdenv.stdenvDarwin;
stdenv = args: let
args' = args // { inherit bootstrapFiles; };
in (import (test-pkgspath + "/pkgs/stdenv/darwin") args').stdenvDarwin;
};
}

View File

@ -175,6 +175,13 @@ rec {
bootstrapTools = (import ./default.nix {
inherit system bootstrapFiles;
lib = assert false; null;
allPackages = assert false; null;
platform = assert false; null;
crossSystem = assert false; null;
config = assert false; null;
}).bootstrapTools;
test = derivation {

View File

@ -23,6 +23,10 @@
, # Allow a configuration attribute set to be passed in as an argument.
config ? {}
, # The standard environment for building packages, or rather a function
# providing it. See below for the arguments given to that function.
stdenv ? assert false; null
, crossSystem ? null
, platform ? assert false; null
} @ args:
@ -72,7 +76,7 @@ in let
inherit lib nixpkgsFun;
} // newArgs);
stdenv = import ../stdenv {
stdenv = (args.stdenv or (import ../stdenv)) {
inherit lib allPackages system platform crossSystem config;
};