From b9c403c5310a61d7274f8490b9a06be8ccd1bc93 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Jul 2017 14:19:31 +0200 Subject: [PATCH 1/2] stdenvLinux: Remove bootstrapTools from closure The "expand-response-params" program had an unnecessary reference to bootstrapTools, bloating the closure from 205 to 314 MiB. --- pkgs/build-support/cc-wrapper/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 676fbd00688..570bb6785df 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -130,6 +130,8 @@ let # Work around "stdenv-darwin-boot-2 is not allowed to refer to path /nix/store/...-expand-response-params.c" cp "$src" expand-response-params.c "$CC" -std=c99 -O3 -o "$out" expand-response-params.c + strip -S $out + ${optionalString hostPlatform.isLinux "patchelf --shrink-rpath $out"} ''; } else ""; From 70d4d22806a2dee5d5c50048742b57ec9dfab433 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 25 Jul 2017 14:22:33 +0200 Subject: [PATCH 2/2] cc-wrapper: Add a "man" output ... and propagate cc.man from there. --- pkgs/build-support/cc-wrapper/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 570bb6785df..7df9615653f 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -147,6 +147,7 @@ stdenv.mkDerivation { inherit cc shell libc_bin libc_dev libc_lib binutils_bin coreutils_bin; gnugrep_bin = if nativeTools then "" else gnugrep; + outputs = [ "out" "man" ]; passthru = { inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile @@ -166,7 +167,7 @@ stdenv.mkDerivation { buildCommand = '' - mkdir -p $out/bin $out/nix-support + mkdir -p $out/bin $out/nix-support $man/nix-support wrap() { local dst="$1" @@ -277,7 +278,8 @@ stdenv.mkDerivation { # Propagate the wrapped cc so that if you install the wrapper, # you get tools like gcov, the manpages, etc. as well (including # for binutils and Glibc). - echo ${cc} ${cc.man or ""} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages + echo ${cc} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages + echo ${cc.man or ""} > $man/nix-support/propagated-user-env-packages echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs ''