diff options
author | John Ericson <jericson@galois.com> | 2016-11-30 18:51:13 -0500 |
---|---|---|
committer | John Ericson <jericson@galois.com> | 2016-12-01 11:24:33 -0500 |
commit | 4751d9e5ad124284dbd719d3a58f42d56f1b9514 (patch) | |
tree | 60531fd147f913face4de51a78c12ae9cc1dd18a /pkgs/stdenv | |
parent | a55d1ecc9050a50904a13e3a34535990b9e61ae3 (diff) |
top-level: turn the screw
- Non-cross stdenvs are honest and assert that `crossSystem` is null - `crossSystem` is a mandatory argument to top-level/stage.nix, just like `system` and `platform` - Broken default arguments on stdenvs for testing are gone. - All stdenvs (but little-used stdenvNix) take the same arguments for easy testing.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/custom/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 10 | ||||
-rw-r--r-- | pkgs/stdenv/default.nix | 16 | ||||
-rw-r--r-- | pkgs/stdenv/freebsd/default.nix | 8 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 10 | ||||
-rw-r--r-- | pkgs/stdenv/native/default.nix | 8 |
6 files changed, 30 insertions, 24 deletions
diff --git a/pkgs/stdenv/custom/default.nix b/pkgs/stdenv/custom/default.nix index 174b8593c0aab..188d002777317 100644 --- a/pkgs/stdenv/custom/default.nix +++ b/pkgs/stdenv/custom/default.nix @@ -2,6 +2,8 @@ , system, platform, crossSystem, config }: +assert crossSystem == null; + rec { vanillaStdenv = import ../. { inherit lib allPackages system platform crossSystem; diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 6182c8cc0c743..b9044f25cd7ac 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -1,7 +1,5 @@ -{ system ? builtins.currentSystem -, allPackages ? import ../../.. -, platform ? null -, config ? {} +{ lib, allPackages +, system, platform, crossSystem, config # Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools , bootstrapFiles ? let @@ -17,6 +15,8 @@ } }: +assert crossSystem == null; + let libSystemProfile = '' (import "${./standard-sandbox.sb}") @@ -100,7 +100,7 @@ in rec { }; thisPkgs = allPackages { - inherit system platform config; + inherit system platform crossSystem config; allowCustomOverrides = false; stdenv = thisStdenv; }; diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 246e656f33bf1..3b49d0de83068 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -9,7 +9,7 @@ lib, allPackages # Args to pass on to `allPacakges` too , system, platform, crossSystem, config -}: +} @ args: let # The native (i.e., impure) build environment. This one uses the @@ -17,7 +17,7 @@ let # i.e., the stuff in /bin, /usr/bin, etc. This environment should # be used with care, since many Nix packages will not build properly # with it (e.g., because they require GNU Make). - inherit (import ./native { inherit system allPackages config; }) stdenvNative; + inherit (import ./native args) stdenvNative; stdenvNativePkgs = allPackages { inherit system platform crossSystem config; @@ -28,22 +28,22 @@ let # The Nix build environment. - stdenvNix = import ./nix { + stdenvNix = assert crossSystem == null; import ./nix { inherit config lib; stdenv = stdenvNative; pkgs = stdenvNativePkgs; }; - inherit (import ./freebsd { inherit system allPackages platform config; }) stdenvFreeBSD; + inherit (import ./freebsd args) stdenvFreeBSD; # Linux standard environment. - inherit (import ./linux { inherit system allPackages platform config lib; }) stdenvLinux; + inherit (import ./linux args) stdenvLinux; - inherit (import ./darwin { inherit system allPackages platform config; }) stdenvDarwin; + inherit (import ./darwin args) stdenvDarwin; - inherit (import ./cross { inherit system allPackages platform crossSystem config lib; }) stdenvCross stdenvCrossiOS; + inherit (import ./cross args) stdenvCross stdenvCrossiOS; - inherit (import ./custom { inherit system allPackages platform crossSystem config lib; }) stdenvCustom; + inherit (import ./custom args) stdenvCustom; # Select the appropriate stdenv for the platform `system'. in diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix index 13cb21fe1d887..ea2ebcc7917a5 100644 --- a/pkgs/stdenv/freebsd/default.nix +++ b/pkgs/stdenv/freebsd/default.nix @@ -1,9 +1,9 @@ -{ system ? builtins.currentSystem -, allPackages ? import ../../.. -, platform ? null -, config ? {} +{ lib, allPackages +, system, platform, crossSystem, config }: +assert crossSystem == null; + rec { inherit allPackages; diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index e4bf87c520249..34196359f525e 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -3,11 +3,9 @@ # external (non-Nix) tools, such as /usr/bin/gcc, and it contains a C # compiler and linker that do not search in default locations, # ensuring purity of components produced by it. +{ lib, allPackages +, system, platform, crossSystem, config -# The function defaults are for easy testing. -{ system ? builtins.currentSystem -, allPackages ? import ../../.. -, platform ? null, config ? {}, lib ? (import ../../../lib) , bootstrapFiles ? if system == "i686-linux" then import ./bootstrap/i686.nix else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix @@ -18,6 +16,8 @@ else abort "unsupported platform for the pure Linux stdenv" }: +assert crossSystem == null; + rec { commonPreHook = @@ -106,7 +106,7 @@ rec { }; thisPkgs = allPackages { - inherit system platform config; + inherit system platform crossSystem config; allowCustomOverrides = false; stdenv = thisStdenv; }; diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index 0f9aee214b30f..8396bd0cb0176 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -1,4 +1,8 @@ -{ system, allPackages ? import ../../.., config }: +{ lib, allPackages +, system, platform, crossSystem, config +}: + +assert crossSystem == null; rec { @@ -126,7 +130,7 @@ rec { } // {inherit fetchurl;}; stdenvBoot1Pkgs = allPackages { - inherit system platform config; + inherit system platform crossSystem config; allowCustomOverrides = false; stdenv = stdenvBoot1; }; |