summary refs log tree commit diff
path: root/pkgs/stdenv/linux
diff options
context:
space:
mode:
authorJohn Ericson <jericson@galois.com>2016-12-15 17:09:29 -0500
committerJohn Ericson <jericson@galois.com>2016-12-15 17:09:29 -0500
commit7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd (patch)
tree482c745af3a462d5c216197d0c64c8c6f6cc7b9a /pkgs/stdenv/linux
parent670256dc399ab637fa94df9a90fb13f275c39f8a (diff)
downloadnixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.tar
nixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.tar.gz
nixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.tar.bz2
nixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.tar.lz
nixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.tar.xz
nixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.tar.zst
nixlib-7960a1b1b8fa1ca097bee2971fbbc18bda3dcadd.zip
linux stdenv: Avoid `assert false`
On one hand, don't want to pass garbage that affects hash, on the other
hand footguns are bad.

Now, factored out the derivation so only need to pass in what is used.
Diffstat (limited to 'pkgs/stdenv/linux')
-rw-r--r--pkgs/stdenv/linux/bootstrap-tools/default.nix18
-rw-r--r--pkgs/stdenv/linux/bootstrap-tools/scripts/unpack-bootstrap-tools.sh (renamed from pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh)0
-rw-r--r--pkgs/stdenv/linux/default.nix17
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix11
4 files changed, 20 insertions, 26 deletions
diff --git a/pkgs/stdenv/linux/bootstrap-tools/default.nix b/pkgs/stdenv/linux/bootstrap-tools/default.nix
new file mode 100644
index 000000000000..6118585d545f
--- /dev/null
+++ b/pkgs/stdenv/linux/bootstrap-tools/default.nix
@@ -0,0 +1,18 @@
+{ system, bootstrapFiles }:
+
+derivation {
+  name = "bootstrap-tools";
+
+  builder = bootstrapFiles.busybox;
+
+  args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
+
+  tarball = bootstrapFiles.bootstrapTools;
+
+  inherit system;
+
+  # Needed by the GCC wrapper.
+  langC = true;
+  langCC = true;
+  isGNU = true;
+}
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/bootstrap-tools/scripts/unpack-bootstrap-tools.sh
index 85e74aea89ef..85e74aea89ef 100644
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
+++ b/pkgs/stdenv/linux/bootstrap-tools/scripts/unpack-bootstrap-tools.sh
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index a39ff61a8b54..9900fc6dd3d5 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -37,22 +37,7 @@ rec {
 
 
   # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
-  bootstrapTools = derivation {
-    name = "bootstrap-tools";
-
-    builder = bootstrapFiles.busybox;
-
-    args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
-
-    tarball = bootstrapFiles.bootstrapTools;
-
-    inherit system;
-
-    # Needed by the GCC wrapper.
-    langC = true;
-    langCC = true;
-    isGNU = true;
-  };
+  bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };
 
 
   # This function builds the various standard environments used during
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index 26dfee252303..e13fb88eff0b 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -173,16 +173,7 @@ rec {
     bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
   };
 
-  bootstrapTools = (import ./default.nix {
-    inherit system bootstrapFiles;
-
-    lib = assert false; null;
-    allPackages = assert false; null;
-
-    platform = assert false; null;
-    crossSystem = null;
-    config = assert false; null;
-  }).bootstrapTools;
+  bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };
 
   test = derivation {
     name = "test-bootstrap-tools";