From 8a445f923710ff1a4885c268a16cb931e3b639f0 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Sat, 23 Aug 2014 20:34:01 +0200 Subject: [PATCH 01/10] Refactor fetchurl handling in stdenvLinux All the different stages of stdenv had the fetchurl inherited anyways, so make this generic in stdenvBootFun. This commit doesn't change the outhash (or drvhash) of the stdenv. --- pkgs/stdenv/linux/default.nix | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 23cccf223f4..71b23a396d9 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -46,7 +46,7 @@ rec { builder = bootstrapFiles.sh; args = - if system == "armv5tel-linux" || system == "armv6l-linux" + if system == "armv5tel-linux" || system == "armv6l-linux" || system == "armv7l-linux" then [ ./scripts/unpack-bootstrap-tools-arm.sh ] else [ ./scripts/unpack-bootstrap-tools.sh ]; @@ -69,9 +69,9 @@ rec { # This function builds the various standard environments used during # the bootstrap. stdenvBootFun = - {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? [], fetchurl}: + {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? []}: - import ../generic { + let thisStdenv = import ../generic { inherit system config; name = "stdenv-linux-boot"; preHook = @@ -83,27 +83,22 @@ rec { ''; shell = "${bootstrapTools}/bin/sh"; initialPath = [bootstrapTools] ++ extraPath; - fetchurlBoot = fetchurl; + fetchurlBoot = import ../../build-support/fetchurl { + stdenv = stdenvLinuxBoot0; + curl = bootstrapTools; + }; inherit gcc; # Having the proper 'platform' in all the stdenvs allows getting proper # linuxHeaders for example. extraAttrs = extraAttrs // { inherit platform; }; - overrides = pkgs: (overrides pkgs) // { - inherit fetchurl; - }; + overrides = pkgs: (overrides pkgs) // { fetchurl = thisStdenv.fetchurlBoot; }; }; + in thisStdenv; # Build a dummy stdenv with no GCC or working fetchurl. This is # because we need a stdenv to build the GCC wrapper and fetchurl. stdenvLinuxBoot0 = stdenvBootFun { gcc = "/no-such-path"; - fetchurl = null; - }; - - - fetchurl = import ../../build-support/fetchurl { - stdenv = stdenvLinuxBoot0; - curl = bootstrapTools; }; @@ -142,7 +137,6 @@ rec { binutils = bootstrapTools; coreutils = bootstrapTools; }; - inherit fetchurl; }; @@ -168,7 +162,6 @@ rec { overrides = pkgs: { inherit (stdenvLinuxBoot1Pkgs) perl; }; - inherit fetchurl; }; @@ -211,7 +204,6 @@ rec { glibc = stdenvLinuxGlibc; # Required by gcc47 build }; extraPath = [ stdenvLinuxBoot1Pkgs.paxctl ]; - inherit fetchurl; }; @@ -238,7 +230,6 @@ rec { inherit (stdenvLinuxBoot1Pkgs) perl; inherit (stdenvLinuxBoot3Pkgs) gettext gnum4 gmp; }; - inherit fetchurl; }; @@ -281,7 +272,7 @@ rec { shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; - fetchurlBoot = fetchurl; + fetchurlBoot = stdenvLinuxBoot0.fetchurlBoot; extraAttrs = { inherit (stdenvLinuxBoot3Pkgs) glibc; From 142970b9eb1925d67b4b9b41d060533fe249f2ec Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Sat, 23 Aug 2014 20:45:32 +0200 Subject: [PATCH 02/10] 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. --- pkgs/stdenv/linux/default.nix | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 71b23a396d9..d2c36b9dc0d 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,16 +268,15 @@ rec { ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;}) ++ [stdenvLinuxBoot4Pkgs.patchelf stdenvLinuxBoot4Pkgs.paxctl ]; - gcc = wrapGCC rec { - inherit (stdenvLinuxBoot4Pkgs) binutils coreutils; - libc = stdenvLinuxGlibc; - gcc = stdenvLinuxBoot4.gcc.gcc; - shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; - name = ""; - }; - shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; + gcc = (wrapGCC rec { + gcc = stdenvLinuxBoot4.gcc.gcc; + libc = stdenvLinuxGlibc; + inherit (stdenvLinuxBoot4Pkgs) binutils coreutils; + name = ""; + }).override { inherit shell; }; + fetchurlBoot = stdenvLinuxBoot0.fetchurlBoot; extraAttrs = { From 350022247a0b59abf42228d1d3fbb4222974b130 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Sat, 23 Aug 2014 21:26:37 +0200 Subject: [PATCH 03/10] Refactor stage handling in stdenvLinux Make stages explicit and generalize the pattern of having an stdenv and a pkgs collection for all stages to a common stage generating function called stageFun. Rewrite all stage handling with this new function. This commit doesn't change the outhash (or drvhash) of the stdenv. --- pkgs/stdenv/linux/default.nix | 187 +++++++++++++++------------------- 1 file changed, 80 insertions(+), 107 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index d2c36b9dc0d..6c910c284a5 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -35,8 +35,8 @@ rec { # The bootstrap process proceeds in several steps. - # 1) Create a standard environment by downloading pre-built binaries - # of coreutils, GCC, etc. + # Create a standard environment by downloading pre-built binaries of + # coreutils, GCC, etc. # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...). @@ -67,11 +67,13 @@ rec { # This function builds the various standard environments used during - # the bootstrap. - stdenvBootFun = + # the bootstrap. In all stages, we build an stdenv and the package + # set that can be built with that stdenv. + stageFun = {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? []}: - let thisStdenv = import ../generic { + let + thisStdenv = import ../generic { inherit system config; name = "stdenv-linux-boot"; preHook = @@ -84,7 +86,7 @@ rec { shell = "${bootstrapTools}/bin/sh"; initialPath = [bootstrapTools] ++ extraPath; fetchurlBoot = import ../../build-support/fetchurl { - stdenv = stdenvLinuxBoot0; + stdenv = stage0.stdenv; curl = bootstrapTools; }; inherit gcc; @@ -93,26 +95,32 @@ rec { extraAttrs = extraAttrs // { inherit platform; }; overrides = pkgs: (overrides pkgs) // { fetchurl = thisStdenv.fetchurlBoot; }; }; - in thisStdenv; + thisPkgs = allPackages { + inherit system platform; + bootStdenv = thisStdenv; + }; + in { stdenv = thisStdenv; pkgs = thisPkgs; }; # Build a dummy stdenv with no GCC or working fetchurl. This is # because we need a stdenv to build the GCC wrapper and fetchurl. - stdenvLinuxBoot0 = stdenvBootFun { + stage0 = stageFun { gcc = "/no-such-path"; - }; - - # The Glibc include directory cannot have the same prefix as the GCC - # include directory, since GCC gets confused otherwise (it will - # search the Glibc headers before the GCC headers). So create a - # dummy Glibc. - bootstrapGlibc = stdenvLinuxBoot0.mkDerivation { - name = "bootstrap-glibc"; - buildCommand = '' - mkdir -p $out - ln -s ${bootstrapTools}/lib $out/lib - ln -s ${bootstrapTools}/include-glibc $out/include - ''; + overrides = pkgs: { + # The Glibc include directory cannot have the same prefix as the + # GCC include directory, since GCC gets confused otherwise (it + # will search the Glibc headers before the GCC headers). So + # create a dummy Glibc here, which will be used in the stdenv of + # stage1. + glibc = stage0.stdenv.mkDerivation { + name = "bootstrap-glibc"; + buildCommand = '' + mkdir -p $out + ln -s ${bootstrapTools}/lib $out/lib + ln -s ${bootstrapTools}/include-glibc $out/include + ''; + }; + }; }; @@ -124,78 +132,58 @@ rec { nativeTools = false; nativeLibc = false; inherit gcc binutils coreutils libc name; - stdenv = stdenvLinuxBoot0; + stdenv = stage0.stdenv; }; # Create the first "real" standard environment. This one consists # of bootstrap tools only, and a minimal Glibc to keep the GCC # configure script happy. - stdenvLinuxBoot1 = stdenvBootFun { + stage1 = stageFun { gcc = wrapGCC { gcc = bootstrapTools; - libc = bootstrapGlibc; + libc = stage0.pkgs.glibc; binutils = bootstrapTools; coreutils = bootstrapTools; name = "bootstrap-gcc-wrapper"; }; + # Rebuild binutils to use from stage2 onwards. + overrides = pkgs: { + binutils = pkgs.binutils.override { gold = false; }; + }; }; - # 2) These are the packages that we can build with the first - # stdenv. We only need binutils, because recent Glibcs - # require recent Binutils, and those in bootstrap-tools may - # be too old. - stdenvLinuxBoot1Pkgs = allPackages { - inherit system platform; - bootStdenv = stdenvLinuxBoot1; - }; - - binutils1 = stdenvLinuxBoot1Pkgs.binutils.override { gold = false; }; - - - # 3) 2nd stdenv that we will use to build only Glibc. - stdenvLinuxBoot2 = stdenvBootFun { + # 2nd stdenv that contains our own rebuilt binutils and is used for + # compiling our own Glibc. + stage2 = stageFun { gcc = wrapGCC { gcc = bootstrapTools; - libc = bootstrapGlibc; - binutils = binutils1; + libc = stage0.pkgs.glibc; + binutils = stage1.pkgs.binutils; coreutils = bootstrapTools; name = "bootstrap-gcc-wrapper"; }; overrides = pkgs: { - inherit (stdenvLinuxBoot1Pkgs) perl; + inherit (stage1.pkgs) perl; + # This also contains the full, dynamically linked, final Glibc. }; }; - # 4) These are the packages that we can build with the 2nd - # stdenv. - stdenvLinuxBoot2Pkgs = allPackages { - inherit system platform; - bootStdenv = stdenvLinuxBoot2; - }; - - - # 5) Build Glibc with the bootstrap tools. The result is the full, - # dynamically linked, final Glibc. - stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc; - - - # 6) Construct a third stdenv identical to the 2nd, except that this - # one uses the Glibc built in step 5. It still uses the recent - # binutils and rest of the bootstrap tools, including GCC. - stdenvLinuxBoot3 = stdenvBootFun { + # Construct a third stdenv identical to the 2nd, except that this + # one uses the rebuilt Glibc from stage2. It still uses the recent + # binutils and rest of the bootstrap tools, including GCC. + stage3 = stageFun { gcc = wrapGCC { gcc = bootstrapTools; - libc = stdenvLinuxGlibc; - binutils = binutils1; + libc = stage2.pkgs.glibc; + binutils = stage1.pkgs.binutils; coreutils = bootstrapTools; name = "bootstrap-gcc-wrapper"; }; overrides = pkgs: { - glibc = stdenvLinuxGlibc; - inherit (stdenvLinuxBoot1Pkgs) perl; + inherit (stage2.pkgs) glibc perl; # Link GCC statically against GMP etc. This makes sense because # these builds of the libraries are only used by GCC, so it # reduces the size of the stdenv closure. @@ -207,52 +195,37 @@ rec { ppl = pkgs.ppl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; }; extraAttrs = { - glibc = stdenvLinuxGlibc; # Required by gcc47 build + glibc = stage2.pkgs.glibc; # Required by gcc47 build }; - extraPath = [ stdenvLinuxBoot1Pkgs.paxctl ]; + extraPath = [ stage1.pkgs.paxctl ]; }; - # 7) The packages that can be built using the third stdenv. - stdenvLinuxBoot3Pkgs = allPackages { - inherit system platform; - bootStdenv = stdenvLinuxBoot3; - }; - - - # 8) Construct a fourth stdenv identical to the second, except that - # this one uses the new GCC from step 7. The other tools - # (e.g. coreutils) are still from the bootstrap tools. - stdenvLinuxBoot4 = stdenvBootFun { - gcc = wrapGCC rec { - gcc = stdenvLinuxBoot3Pkgs.gcc.gcc; - libc = stdenvLinuxGlibc; - binutils = binutils1; + # Construct a fourth stdenv that uses the new GCC. But coreutils is + # still from the bootstrap tools. + stage4 = stageFun { + gcc = wrapGCC { + gcc = stage3.pkgs.gcc.gcc; + libc = stage2.pkgs.glibc; + binutils = stage1.pkgs.binutils; coreutils = bootstrapTools; name = ""; }; - extraPath = [ stdenvLinuxBoot3Pkgs.xz ]; + extraPath = [ stage3.pkgs.xz ]; overrides = pkgs: { - inherit (stdenvLinuxBoot1Pkgs) perl; - inherit (stdenvLinuxBoot3Pkgs) gettext gnum4 gmp; + inherit (stage1.pkgs) perl; + inherit (stage3.pkgs) gettext gnum4 gmp glibc; }; }; - # 9) The packages that can be built using the fourth stdenv. - stdenvLinuxBoot4Pkgs = allPackages { - inherit system platform; - bootStdenv = stdenvLinuxBoot4; - }; - - - # 10) Construct the final stdenv. It uses the Glibc and GCC, and - # adds in a new binutils that doesn't depend on bootstrap-tools, - # as well as dynamically linked versions of all other tools. + # Construct the final stdenv. It uses the Glibc and GCC, and adds + # in a new binutils that doesn't depend on bootstrap-tools, as well + # as dynamically linked versions of all other tools. # - # When updating stdenvLinux, make sure that the result has no - # dependency (`nix-store -qR') on bootstrapTools or the - # first binutils built. + # When updating stdenvLinux, make sure that the result has no + # dependency (`nix-store -qR') on bootstrapTools or the first + # binutils built. stdenvLinux = import ../generic rec { inherit system config; @@ -265,31 +238,31 @@ rec { ''; initialPath = - ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;}) - ++ [stdenvLinuxBoot4Pkgs.patchelf stdenvLinuxBoot4Pkgs.paxctl ]; + ((import ../common-path.nix) {pkgs = stage4.pkgs;}) + ++ [stage4.pkgs.patchelf stage4.pkgs.paxctl ]; - shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash"; + shell = stage4.pkgs.bash + "/bin/bash"; gcc = (wrapGCC rec { - gcc = stdenvLinuxBoot4.gcc.gcc; - libc = stdenvLinuxGlibc; - inherit (stdenvLinuxBoot4Pkgs) binutils coreutils; + gcc = stage4.stdenv.gcc.gcc; + libc = stage4.pkgs.glibc; + inherit (stage4.pkgs) binutils coreutils; name = ""; }).override { inherit shell; }; - fetchurlBoot = stdenvLinuxBoot0.fetchurlBoot; + fetchurlBoot = stage4.stdenv.fetchurl; extraAttrs = { - inherit (stdenvLinuxBoot3Pkgs) glibc; + inherit (stage4.pkgs) glibc; inherit platform bootstrapTools; - shellPackage = stdenvLinuxBoot4Pkgs.bash; + shellPackage = stage4.pkgs.bash; }; overrides = pkgs: { inherit gcc; - inherit (stdenvLinuxBoot3Pkgs) glibc; - inherit (stdenvLinuxBoot4Pkgs) binutils; - inherit (stdenvLinuxBoot4Pkgs) + inherit (stage3.pkgs) glibc; + inherit (stage4.pkgs) binutils; + inherit (stage4.pkgs) gzip bzip2 xz bash coreutils diffutils findutils gawk gnumake gnused gnutar gnugrep gnupatch patchelf attr acl paxctl; From 49e5837780b9811f5cb9f36979a3a3b737b2d94f Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Sun, 24 Aug 2014 15:47:10 +0200 Subject: [PATCH 04/10] Move wrapGCC helper up This commit doesn't change the outhash (or drvhash) of the stdenv. --- pkgs/stdenv/linux/default.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 6c910c284a5..2d96869f23e 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -66,6 +66,18 @@ rec { }; + # A helper function to call gcc-wrapper. + wrapGCC = + { gcc, libc, binutils, coreutils, name }: + + lib.makeOverridable (import ../../build-support/gcc-wrapper) { + nativeTools = false; + nativeLibc = false; + inherit gcc binutils coreutils libc name; + stdenv = stage0.stdenv; + }; + + # This function builds the various standard environments used during # the bootstrap. In all stages, we build an stdenv and the package # set that can be built with that stdenv. @@ -101,6 +113,7 @@ rec { }; in { stdenv = thisStdenv; pkgs = thisPkgs; }; + # Build a dummy stdenv with no GCC or working fetchurl. This is # because we need a stdenv to build the GCC wrapper and fetchurl. stage0 = stageFun { @@ -124,18 +137,6 @@ rec { }; - # A helper function to call gcc-wrapper. - wrapGCC = - { gcc, libc, binutils, coreutils, name }: - - lib.makeOverridable (import ../../build-support/gcc-wrapper) { - nativeTools = false; - nativeLibc = false; - inherit gcc binutils coreutils libc name; - stdenv = stage0.stdenv; - }; - - # Create the first "real" standard environment. This one consists # of bootstrap tools only, and a minimal Glibc to keep the GCC # configure script happy. From ea65229f70fe75ebc8440d69575a9b8f2e573da0 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Sun, 24 Aug 2014 15:55:14 +0200 Subject: [PATCH 05/10] Refactor stages to only ever refer to the previous stage This commit doesn't change the outhash (or drvhash) of the stdenv. --- pkgs/stdenv/linux/default.nix | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 2d96869f23e..6d54228978f 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -140,6 +140,13 @@ rec { # Create the first "real" standard environment. This one consists # of bootstrap tools only, and a minimal Glibc to keep the GCC # configure script happy. + # + # For clarity, we only use the previous stage when specifying these + # stages. So stageN should only ever have references for stage{N-1}. + # + # If we ever need to use a package from more than one stage back, we + # simply re-export those packages in the middle stage(s) using the + # overrides attribute and the inherit syntax. stage1 = stageFun { gcc = wrapGCC { gcc = bootstrapTools; @@ -151,6 +158,7 @@ rec { # Rebuild binutils to use from stage2 onwards. overrides = pkgs: { binutils = pkgs.binutils.override { gold = false; }; + inherit (stage0.pkgs) glibc; }; }; @@ -160,13 +168,13 @@ rec { stage2 = stageFun { gcc = wrapGCC { gcc = bootstrapTools; - libc = stage0.pkgs.glibc; + libc = stage1.pkgs.glibc; binutils = stage1.pkgs.binutils; coreutils = bootstrapTools; name = "bootstrap-gcc-wrapper"; }; overrides = pkgs: { - inherit (stage1.pkgs) perl; + inherit (stage1.pkgs) perl binutils paxctl; # This also contains the full, dynamically linked, final Glibc. }; }; @@ -179,12 +187,12 @@ rec { gcc = wrapGCC { gcc = bootstrapTools; libc = stage2.pkgs.glibc; - binutils = stage1.pkgs.binutils; + binutils = stage2.pkgs.binutils; coreutils = bootstrapTools; name = "bootstrap-gcc-wrapper"; }; overrides = pkgs: { - inherit (stage2.pkgs) glibc perl; + inherit (stage2.pkgs) binutils glibc perl; # Link GCC statically against GMP etc. This makes sense because # these builds of the libraries are only used by GCC, so it # reduces the size of the stdenv closure. @@ -198,7 +206,7 @@ rec { extraAttrs = { glibc = stage2.pkgs.glibc; # Required by gcc47 build }; - extraPath = [ stage1.pkgs.paxctl ]; + extraPath = [ stage2.pkgs.paxctl ]; }; @@ -207,15 +215,14 @@ rec { stage4 = stageFun { gcc = wrapGCC { gcc = stage3.pkgs.gcc.gcc; - libc = stage2.pkgs.glibc; - binutils = stage1.pkgs.binutils; + libc = stage3.pkgs.glibc; + binutils = stage3.pkgs.binutils; coreutils = bootstrapTools; name = ""; }; extraPath = [ stage3.pkgs.xz ]; overrides = pkgs: { - inherit (stage1.pkgs) perl; - inherit (stage3.pkgs) gettext gnum4 gmp glibc; + inherit (stage3.pkgs) gettext gnum4 gmp perl glibc; }; }; @@ -261,11 +268,9 @@ rec { overrides = pkgs: { inherit gcc; - inherit (stage3.pkgs) glibc; - inherit (stage4.pkgs) binutils; inherit (stage4.pkgs) - gzip bzip2 xz bash coreutils diffutils findutils gawk - gnumake gnused gnutar gnugrep gnupatch patchelf + gzip bzip2 xz bash binutils coreutils diffutils findutils gawk + glibc gnumake gnused gnutar gnugrep gnupatch patchelf attr acl paxctl; }; }; From 27d39849355d1a39f8538d09c52e04f8f87510ea Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 24 Aug 2014 18:08:23 +0200 Subject: [PATCH 06/10] Indentation --- pkgs/stdenv/linux/default.nix | 53 ++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 6d54228978f..80bc982267b 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -85,32 +85,35 @@ rec { {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? []}: let - thisStdenv = import ../generic { - inherit system config; - name = "stdenv-linux-boot"; - preHook = - '' - # Don't patch #!/interpreter because it leads to retained - # dependencies on the bootstrapTools in the final stdenv. - dontPatchShebangs=1 - ${commonPreHook} - ''; - shell = "${bootstrapTools}/bin/sh"; - initialPath = [bootstrapTools] ++ extraPath; - fetchurlBoot = import ../../build-support/fetchurl { - stdenv = stage0.stdenv; - curl = bootstrapTools; + + thisStdenv = import ../generic { + inherit system config; + name = "stdenv-linux-boot"; + preHook = + '' + # Don't patch #!/interpreter because it leads to retained + # dependencies on the bootstrapTools in the final stdenv. + dontPatchShebangs=1 + ${commonPreHook} + ''; + shell = "${bootstrapTools}/bin/sh"; + initialPath = [bootstrapTools] ++ extraPath; + fetchurlBoot = import ../../build-support/fetchurl { + stdenv = stage0.stdenv; + curl = bootstrapTools; + }; + inherit gcc; + # Having the proper 'platform' in all the stdenvs allows getting proper + # linuxHeaders for example. + extraAttrs = extraAttrs // { inherit platform; }; + overrides = pkgs: (overrides pkgs) // { fetchurl = thisStdenv.fetchurlBoot; }; }; - inherit gcc; - # Having the proper 'platform' in all the stdenvs allows getting proper - # linuxHeaders for example. - extraAttrs = extraAttrs // { inherit platform; }; - overrides = pkgs: (overrides pkgs) // { fetchurl = thisStdenv.fetchurlBoot; }; - }; - thisPkgs = allPackages { - inherit system platform; - bootStdenv = thisStdenv; - }; + + thisPkgs = allPackages { + inherit system platform; + bootStdenv = thisStdenv; + }; + in { stdenv = thisStdenv; pkgs = thisPkgs; }; From f5d648e27d1b31c91740d536a88e7d2c251aaf79 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Aug 2014 09:35:06 +0200 Subject: [PATCH 07/10] Fix evaluation --- pkgs/stdenv/linux/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 80bc982267b..1daebd9dd36 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -261,7 +261,7 @@ rec { name = ""; }).override { inherit shell; }; - fetchurlBoot = stage4.stdenv.fetchurl; + inherit (stage4.stdenv) fetchurlBoot; extraAttrs = { inherit (stage4.pkgs) glibc; From 1f2b636ff62ed6df735c6ee187f495c6371d9283 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Mon, 25 Aug 2014 21:16:38 +0200 Subject: [PATCH 08/10] Fix zlib handling in stdenvLinux Previously stdenv depended on two different zlibs and there was a third one in the top-level package set for other purposes. This commit merges all this zlibs to one. --- pkgs/stdenv/linux/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 1daebd9dd36..6f8b42c2266 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -225,7 +225,11 @@ rec { }; extraPath = [ stage3.pkgs.xz ]; overrides = pkgs: { - inherit (stage3.pkgs) gettext gnum4 gmp perl glibc; + # Zlib has to be inherited and not rebuilt in this stage, + # because gcc (since JAR support) already depends on zlib, and + # then if we already have a zlib we want to use that for the + # other purposes (binutils and top-level pkgs) too. + inherit (stage3.pkgs) gettext gnum4 gmp perl glibc zlib; }; }; @@ -274,7 +278,7 @@ rec { inherit (stage4.pkgs) gzip bzip2 xz bash binutils coreutils diffutils findutils gawk glibc gnumake gnused gnutar gnugrep gnupatch patchelf - attr acl paxctl; + attr acl paxctl zlib; }; }; From dd3f3bdcc28282e6d235ff16d7173ee9ea81d7b0 Mon Sep 17 00:00:00 2001 From: Gergely Risko Date: Thu, 28 Aug 2014 18:03:22 +0200 Subject: [PATCH 09/10] GCC >= 4.8 doesn't depend on ppl --- pkgs/development/compilers/gcc/4.8/default.nix | 16 ++-------------- pkgs/development/compilers/gcc/4.9/default.nix | 13 +------------ 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 7985b445ae0..f56ee003f50 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -13,7 +13,7 @@ , perl ? null # optional, for texi2pod (then pod2man); required for Java , gmp, mpfr, mpc, gettext, which , libelf # optional, for link-time optimizations (LTO) -, ppl ? null, cloog ? null, isl ? null # optional, for the Graphite optimization framework. +, cloog ? null, isl ? null # optional, for the Graphite optimization framework. , zlib ? null, boehmgc ? null , zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null @@ -276,7 +276,6 @@ stdenv.mkDerivation ({ ++ (optional javaAwtGtk pkgconfig); buildInputs = [ gmp mpfr mpc libelf ] - ++ (optional (ppl != null) ppl) ++ (optional (cloog != null) cloog) ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) @@ -293,15 +292,7 @@ stdenv.mkDerivation ({ NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; - preConfigure = '' - configureFlagsArray=( - ${stdenv.lib.optionalString (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic) - "'--with-host-libstdcxx=-lstdc++ -lgcc_s'"} - ${stdenv.lib.optionalString (ppl != null && stdenv.isSunOS) - "\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\" - \"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""} - ); - '' + stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) '' + preConfigure = stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) '' export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g` export LDFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $LDFLAGS_FOR_TARGET" export CXXFLAGS_FOR_TARGET="-Wl,-rpath,$prefix/lib/amd64 $CXXFLAGS_FOR_TARGET" @@ -329,7 +320,6 @@ stdenv.mkDerivation ({ ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"} ${if enableShared then "" else "--disable-shared"} ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${if ppl != null then "--with-ppl=${ppl} --disable-ppl-version-check" else ""} ${optionalString (isl != null) "--with-isl=${isl}"} ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"} ${if langJava then @@ -412,7 +402,6 @@ stdenv.mkDerivation ({ configureFlags = '' ${if enableMultilib then "" else "--disable-multilib"} ${if enableShared then "" else "--disable-shared"} - ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""} ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""} ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} @@ -521,7 +510,6 @@ stdenv.mkDerivation ({ maintainers = with stdenv.lib.maintainers; [ ludo viric shlevy simons ]; - # Volunteers needed for the {Cyg,Dar}win ports of *PPL. # gnatboot is not available out of linux platforms, so we disable the darwin build # for the gnat (ada compiler). platforms = diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index f61e6b4445a..d38040a48b3 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -11,7 +11,7 @@ , perl ? null # optional, for texi2pod (then pod2man); required for Java , gmp, mpfr, mpc, gettext, which , libelf # optional, for link-time optimizations (LTO) -, ppl ? null, cloog ? null, isl ? null # optional, for the Graphite optimization framework. +, cloog ? null, isl ? null # optional, for the Graphite optimization framework. , zlib ? null, boehmgc ? null , zip ? null, unzip ? null, pkgconfig ? null, gtk ? null, libart_lgpl ? null , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null @@ -273,7 +273,6 @@ stdenv.mkDerivation ({ ++ (optional javaAwtGtk pkgconfig); buildInputs = [ gmp mpfr mpc libelf ] - ++ (optional (ppl != null) ppl) ++ (optional (cloog != null) cloog) ++ (optional (isl != null) isl) ++ (optional (zlib != null) zlib) @@ -291,13 +290,6 @@ stdenv.mkDerivation ({ NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isSunOS "-lm -ldl"; preConfigure = '' - configureFlagsArray=( - ${stdenv.lib.optionalString (ppl != null && ppl ? dontDisableStatic && ppl.dontDisableStatic) - "'--with-host-libstdcxx=-lstdc++ -lgcc_s'"} - ${stdenv.lib.optionalString (ppl != null && stdenv.isSunOS) - "\"--with-host-libstdcxx=-Wl,-rpath,\$prefix/lib/amd64 -lstdc++\" - \"--with-boot-ldflags=-L../prev-x86_64-pc-solaris2.11/libstdc++-v3/src/.libs\""} - ); ${stdenv.lib.optionalString (stdenv.isSunOS && stdenv.is64bit) '' export NIX_LDFLAGS=`echo $NIX_LDFLAGS | sed -e s~$prefix/lib~$prefix/lib/amd64~g` @@ -319,7 +311,6 @@ stdenv.mkDerivation ({ ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"} ${if enableShared then "" else "--disable-shared"} ${if enablePlugin then "--enable-plugin" else "--disable-plugin"} - ${if ppl != null then "--with-ppl=${ppl} --disable-ppl-version-check" else ""} ${optionalString (isl != null) "--with-isl=${isl}"} ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"} ${if langJava then @@ -400,7 +391,6 @@ stdenv.mkDerivation ({ configureFlags = '' ${if enableMultilib then "" else "--disable-multilib"} ${if enableShared then "" else "--disable-shared"} - ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""} ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""} ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""} ${if javaAwtGtk then "--enable-java-awt=gtk" else ""} @@ -507,7 +497,6 @@ stdenv.mkDerivation ({ maintainers = with stdenv.lib.maintainers; [ ludo viric shlevy simons ]; - # Volunteers needed for the {Cyg,Dar}win ports of *PPL. # gnatboot is not available out of linux platforms, so we disable the darwin build # for the gnat (ada compiler). platforms = From 60902b97fe4a96d370bc0c5e3690fa45da77d78d Mon Sep 17 00:00:00 2001 From: Mateusz Kowalczyk Date: Fri, 29 Aug 2014 11:40:46 +0100 Subject: [PATCH 10/10] ed: update to 1.10 (close #3852) --- pkgs/applications/editors/ed/default.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix index d3e9a4c4679..b1b9616eaab 100644 --- a/pkgs/applications/editors/ed/default.nix +++ b/pkgs/applications/editors/ed/default.nix @@ -1,11 +1,12 @@ -{ fetchurl, stdenv }: +{ fetchurl, stdenv, lzip }: stdenv.mkDerivation rec { - name = "ed-1.9"; + version = "1.10"; + name = "ed-${version}"; src = fetchurl { - url = "mirror://gnu/ed/${name}.tar.gz"; - sha256 = "122syihsx2hwzj75mkf5a9ssiky2xby748kp4cc00wzhmp7p5cym"; + url = "mirror://gnu/ed/${name}.tar.lz"; + sha256 = "16kycdm5fcvpdr41hxb2da8da6jzs9dqznsg5552z6rh28n0jh4m"; }; /* FIXME: Tests currently fail on Darwin: @@ -23,6 +24,8 @@ stdenv.mkDerivation rec { compileFlags = [ "CC=${stdenv.cross.config}-gcc" ]; }; + buildInputs = [ lzip ]; + meta = { description = "GNU ed, an implementation of the standard Unix editor"; @@ -38,9 +41,7 @@ stdenv.mkDerivation rec { ''; license = stdenv.lib.licenses.gpl3Plus; - homepage = http://www.gnu.org/software/ed/; - - maintainers = [ ]; + maintainers = with stdenv.lib.maintainers; [ fuuzetsu ]; }; }