From f4792cdc0cffc0d1843f5d8bb3e458546646f67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 28 Jun 2016 09:48:56 +0200 Subject: [PATCH] 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 --- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 6 ++++-- pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 4 +++- pkgs/stdenv/linux/make-bootstrap-tools.nix | 4 +++- pkgs/tools/misc/coreutils/default.nix | 5 ++++- 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 40f26dc2450..43775d0350b 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 16099dfb3d3..6dfe1bf41e4 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 8ffeebaa962..866906662ae 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 d08dd303341..4ed43a18988 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 ]