summary refs log tree commit diff
path: root/pkgs/top-level/stage.nix
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2016-11-27 12:35:58 -0800
committerJohn Ericson <jericson@galois.com>2016-11-30 19:10:59 -0500
commitd240a0da1ab03ef8838553229b72b9b37a0ef3e7 (patch)
treea1a6eeec3d31abe66228d2c14534d50dfc95e882 /pkgs/top-level/stage.nix
parent07a2b17cbf541c485e04f1a8ec98ffe8c24ac713 (diff)
downloadnixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.tar
nixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.tar.gz
nixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.tar.bz2
nixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.tar.lz
nixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.tar.xz
nixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.tar.zst
nixpkgs-d240a0da1ab03ef8838553229b72b9b37a0ef3e7.zip
top-level: Remove cycles: stdenv calls in top-level but not vice versa
This commit changes the dependencies of stdenv, and clean-up the stdenv
story by removing the `defaultStdenv` attribute as well as the `bootStdenv`
parameter.

Before, the final bootstrapping stage's stdenv was provided by
all-packages, which was iterating multiple times over the
top-level/default.nix expression, and non-final bootstrapping stages'
stdenvs were explicitly specified with the `bootStdenv` parameter.

Now, all stages' stdenvs are specified with the `stdenv` parameter.
For non-final bootstrapping stages, this is a small change---basically just
rename the parameter.
For the final stage, top-level/default.nix takes the chosen stdenv and
makes the final stage with it.

`allPackages` is used to make all bootstrapping stages, final and
non-final alike. It's basically the expression of `stage.nix` (along with a
few partially-applied default arguments)

Note, the make-bootstrap-tools scripts are temporarily broken
Diffstat (limited to 'pkgs/top-level/stage.nix')
-rw-r--r--pkgs/top-level/stage.nix27
1 files changed, 14 insertions, 13 deletions
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 9ab9d22e54f..0c621b81c7e 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -1,21 +1,24 @@
-/* This file composes the Nix Packages collection.  That is, it
-   imports the functions that build the various packages, and calls
-   them with appropriate arguments.  The result is a set of all the
-   packages in the Nix Packages collection for some particular
-   platform. */
+/* This file composes a single bootstrapping stage of the Nix Packages
+   collection. That is, it imports the functions that build the various
+   packages, and calls them with appropriate arguments. The result is a set of
+   all the packages in the Nix Packages collection for some particular platform
+   for some particular stage.
+
+   Default arguments are only provided for bootstrapping
+   arguments. Normal users should not import this directly but instead
+   import `pkgs/default.nix` or `default.nix`. */
 
 
 { # The system (e.g., `i686-linux') for which to build the packages.
   system
 
-, # The standard environment to use.  Only used for bootstrapping.  If
-  # null, the default standard environment is used.
-  bootStdenv ? null
+, # The standard environment to use for building packages.
+  stdenv
 
 , # This is used because stdenv replacement and the stdenvCross do benefit from
   # the overridden configuration provided by the user, as opposed to the normal
   # bootstrapping stdenvs.
-  allowCustomOverrides ? (bootStdenv == null)
+  allowCustomOverrides ? true
 
 , # Non-GNU/Linux OSes are currently "impure" platforms, with their libc
   # outside of the store.  Thus, GCC, GFortran, & co. must always look for
@@ -45,9 +48,7 @@ let
     };
 
   stdenvDefault = self: super:
-    import ./stdenv.nix {
-      inherit system bootStdenv crossSystem config platform lib nixpkgsFun;
-    };
+    { stdenv = stdenv // { inherit platform; }; };
 
   allPackages = self: super:
     let res = import ./all-packages.nix
@@ -81,9 +82,9 @@ let
 
   # The complete chain of package set builders, applied from top to bottom
   toFix = lib.foldl' (lib.flip lib.extends) (self: {}) [
+    stdenvDefault
     stdenvAdapters
     trivialBuilders
-    stdenvDefault
     allPackages
     aliases
     stdenvOverrides