about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGergely Risko <errge@nilcons.com>2014-08-23 20:45:32 +0200
committerGergely Risko <errge@nilcons.com>2014-08-24 17:10:37 +0200
commit142970b9eb1925d67b4b9b41d060533fe249f2ec (patch)
tree44aab216693b4705cf96bdcb7ff415cd622768e7
parent8a445f923710ff1a4885c268a16cb931e3b639f0 (diff)
downloadnixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.tar
nixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.tar.gz
nixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.tar.bz2
nixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.tar.lz
nixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.tar.xz
nixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.tar.zst
nixlib-142970b9eb1925d67b4b9b41d060533fe249f2ec.zip
Refactor wrapGCC in stdenvLinux
Don't use default parameter values, to make the callsites more readable
and for easier debuggability/changability.  Also reordered the
callsites' parameter ordering for consistency.

In the final stdenv don't repeat the name of the shell.

This commit doesn't change the outhash (or drvhash) of the stdenv.
-rw-r--r--pkgs/stdenv/linux/default.nix29
1 files changed, 17 insertions, 12 deletions
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 71b23a396d9a..d2c36b9dc0db 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -118,12 +118,12 @@ rec {
 
   # A helper function to call gcc-wrapper.
   wrapGCC =
-    { gcc ? bootstrapTools, libc, binutils, coreutils, shell ? "", name ? "bootstrap-gcc-wrapper" }:
+    { gcc, libc, binutils, coreutils, name }:
 
     lib.makeOverridable (import ../../build-support/gcc-wrapper) {
       nativeTools = false;
       nativeLibc = false;
-      inherit gcc binutils coreutils libc shell name;
+      inherit gcc binutils coreutils libc name;
       stdenv = stdenvLinuxBoot0;
     };
 
@@ -133,9 +133,11 @@ rec {
   # configure script happy.
   stdenvLinuxBoot1 = stdenvBootFun {
     gcc = wrapGCC {
+      gcc = bootstrapTools;
       libc = bootstrapGlibc;
       binutils = bootstrapTools;
       coreutils = bootstrapTools;
+      name = "bootstrap-gcc-wrapper";
     };
   };
 
@@ -155,9 +157,11 @@ rec {
   # 3) 2nd stdenv that we will use to build only Glibc.
   stdenvLinuxBoot2 = stdenvBootFun {
     gcc = wrapGCC {
+      gcc = bootstrapTools;
       libc = bootstrapGlibc;
       binutils = binutils1;
       coreutils = bootstrapTools;
+      name = "bootstrap-gcc-wrapper";
     };
     overrides = pkgs: {
       inherit (stdenvLinuxBoot1Pkgs) perl;
@@ -183,9 +187,11 @@ rec {
   #    binutils and rest of the bootstrap tools, including GCC.
   stdenvLinuxBoot3 = stdenvBootFun {
     gcc = wrapGCC {
+      gcc = bootstrapTools;
+      libc = stdenvLinuxGlibc;
       binutils = binutils1;
       coreutils = bootstrapTools;
-      libc = stdenvLinuxGlibc;
+      name = "bootstrap-gcc-wrapper";
     };
     overrides = pkgs: {
       glibc = stdenvLinuxGlibc;
@@ -219,10 +225,10 @@ rec {
   #    (e.g. coreutils) are still from the bootstrap tools.
   stdenvLinuxBoot4 = stdenvBootFun {
     gcc = wrapGCC rec {
+      gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
+      libc = stdenvLinuxGlibc;
       binutils = binutils1;
       coreutils = bootstrapTools;
-      libc = stdenvLinuxGlibc;
-      gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
       name = "";
     };
     extraPath = [ stdenvLinuxBoot3Pkgs.xz ];
@@ -262,15 +268,14 @@ rec {
       ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
       ++ [stdenvLinuxBoot4Pkgs.patchelf stdenvLinuxBoot4Pkgs.paxctl ];
 
-    gcc = wrapGCC rec {
-      inherit (stdenvLinuxBoot4Pkgs) binutils coreutils;
-      libc = stdenvLinuxGlibc;
+    shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
+
+    gcc = (wrapGCC rec {
       gcc = stdenvLinuxBoot4.gcc.gcc;
-      shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
+      libc = stdenvLinuxGlibc;
+      inherit (stdenvLinuxBoot4Pkgs) binutils coreutils;
       name = "";
-    };
-
-    shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
+    }).override { inherit shell; };
 
     fetchurlBoot = stdenvLinuxBoot0.fetchurlBoot;