git.iko.soy/typeable/nixpkgs
on master help sign in
top-level: Make config-overriden stdenv bootstrap more normally
commit6bfe04277f40a0da27fa6373edfb24a6b139548b authorJohn Ericson <Ericson2314@Yahoo.com> dateWed 27 Apr 2016, 09:09 (11 years ago) parentea7bf02
4 files changed+29−14
pkgs/stdenv/cross/default.nix+6−2 pkgs/stdenv/custom/default.nix+17 pkgs/stdenv/default.nix+3 pkgs/top-level/stdenv.nix+3−12
pkgs/stdenv/cross/default.nix+6−2
@@ -1,9 +1,13 @@
11{ system, allPackages, platform, crossSystem, config, ... } @ args:
22
33rec {
4− vanillaStdenv = (import ../. (args // {
4+ argClobber = {
55 crossSystem = null;
6− allPackages = args: allPackages ({ crossSystem = null; } // args);
6+ # Ignore custom stdenvs when cross compiling for compatability
7+ config = builtins.removeAttrs config [ "replaceStdenv" ];
8+ };
9+ vanillaStdenv = (import ../. (args // argClobber // {
10+ allPackages = args: allPackages (argClobber // args);
711 })).stdenv;
812
913 # Yeah this isn't so cleanly just build-time packages yet. Notice the
pkgs/stdenv/custom/default.nixnew file+17
@@ -0,0 +1,17 @@
1+{ system, allPackages, platform, crossSystem, config, ... } @ args:
2+
3+rec {
4+ vanillaStdenv = (import ../. (args // {
5+ # Remove config.replaceStdenv to ensure termination.
6+ config = builtins.removeAttrs config [ "replaceStdenv" ];
7+ })).stdenv;
8+
9+ buildPackages = allPackages {
10+ # It's OK to change the built-time dependencies
11+ allowCustomOverrides = true;
12+ bootStdenv = vanillaStdenv;
13+ inherit system platform crossSystem config;
14+ };
15+
16+ stdenvCustom = config.replaceStdenv { pkgs = buildPackages; };
17+}
pkgs/stdenv/default.nix+3
@@ -40,9 +40,12 @@ rec {
4040
4141 inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross;
4242
43+ inherit (import ./custom { inherit system allPackages platform crossSystem config lib; }) stdenvCustom;
44+
4345 # Select the appropriate stdenv for the platform `system'.
4446 stdenv =
4547 if crossSystem != null then stdenvCross else
48+ if config ? replaceStdenv then stdenvCustom else
4649 if system == "i686-linux" then stdenvLinux else
4750 if system == "x86_64-linux" then stdenvLinux else
4851 if system == "armv5tel-linux" then stdenvLinux else
pkgs/top-level/stdenv.nix+3−12
@@ -9,16 +9,7 @@ rec {
99 defaultStdenv = allStdenvs.stdenv // { inherit platform; };
1010
1111 stdenv =
12− if bootStdenv != null then
13− (bootStdenv // { inherit platform; })
14− else if crossSystem == null && config ? replaceStdenv then
15− config.replaceStdenv {
16− # We import again all-packages to avoid recursivities.
17− pkgs = nixpkgsFun {
18− # We remove packageOverrides to avoid recursivities
19− config = removeAttrs config [ "replaceStdenv" ];
20− };
21− }
22− else
23− defaultStdenv;
12+ if bootStdenv != null
13+ then (bootStdenv // { inherit platform; })
14+ else defaultStdenv;
2415}