about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-06-28 09:48:56 +0200
committerVladimír Čunát <vcunat@gmail.com>2016-06-28 09:54:22 +0200
commitf4792cdc0cffc0d1843f5d8bb3e458546646f67c (patch)
treebc1c1407e82b104c93bf1ec5256c47c1472128aa
parent19e80fa19d01fb0f15d6b99c860c7a9b0de264b2 (diff)
downloadnixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.tar
nixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.tar.gz
nixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.tar.bz2
nixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.tar.lz
nixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.tar.xz
nixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.tar.zst
nixlib-f4792cdc0cffc0d1843f5d8bb3e458546646f67c.zip
make-bootstrap-tools*: fixup after #16406
Our coreutils now uses single-binary-build mode where, by default,
simple shebang scripts are used for all the binaries. That doesn't work
e.g. with the Linux unpacker which only handles standard binaries and
symlinks. Let's use the symlinked mode instead for boostrapping.
This does NOT change any stdenv hashes.

I only tested the case most important to me:
$ nix-build pkgs/top-level/release.nix -A stdenvBootstrapTools.x86_64-linux.test
-rw-r--r--pkgs/stdenv/darwin/make-bootstrap-tools.nix6
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-cross.nix4
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix4
-rw-r--r--pkgs/tools/misc/coreutils/default.nix5
4 files changed, 14 insertions, 5 deletions
diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
index 40f26dc2450b..43775d0350b8 100644
--- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
@@ -3,9 +3,11 @@
 with import ../../.. { inherit system; };
 
 rec {
-  # We want coreutils without ACL support.
-  coreutils_ = coreutils.override (orig: {
+  coreutils_ = coreutils.override (args: {
+    # We want coreutils without ACL support.
     aclSupport = false;
+    # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
+    singleBinary = "symlinks";
   });
 
   build = stdenv.mkDerivation {
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
index 16099dfb3d39..6dfe1bf41e4f 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
@@ -87,9 +87,11 @@ in
 
 rec {
 
-  # We want coreutils without ACL support.
   coreutilsMinimal = (pkgs.coreutils.override (args: {
+    # We want coreutils without ACL support.
     aclSupport = false;
+    # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
+    singleBinary = "symlinks";
   })).crossDrv;
 
   curlMinimal = (pkgs.curl.override {
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index 8ffeebaa962e..866906662aea 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -5,9 +5,11 @@ with import ../../.. {inherit system;};
 rec {
 
 
-  # We want coreutils without ACL support.
   coreutilsMinimal = coreutils.override (args: {
+    # We want coreutils without ACL support.
     aclSupport = false;
+    # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
+    singleBinary = "symlinks";
   });
 
   tarMinimal = gnutar.override { acl = null; };
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index d08dd303341b..4ed43a189882 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -3,6 +3,7 @@
 , selinuxSupport? false, libselinux ? null, libsepol ? null
 , autoconf, automake114x, texinfo
 , withPrefix ? false
+, singleBinary ? true # you can also pass "symlinks", for example
 }:
 
 assert aclSupport -> acl != null;
@@ -30,7 +31,9 @@ let
     outputs = [ "out" "info" ];
 
     nativeBuildInputs = [ perl xz.bin ];
-    configureFlags = [ "--enable-single-binary" ]
+    configureFlags =
+      optional (singleBinary != false)
+        ("--enable-single-binary" + optionalString (isString singleBinary) "=${singleBinary}")
       ++ optional stdenv.isSunOS "ac_cv_func_inotify_init=no";
 
     buildInputs = [ gmp ]