Commit 3cb745d5 authored by John Ericson's avatar John Ericson
Browse files

stdenv: Store one package per line in nix-support/propagated-*

This makes those files a bit easier to read. Also, for what it's worth,
it brings us one baby step closer to handling spaces in store paths.

Also, I optimized handling of many transitive deps with read. Probably,
not very beneficial, but nice to enforce the pkg-per-line structure.
Doing so let me find much dubious code and fix it.

Two misc notes:

 - `propagated-user-env-packages` also needed to be adjusted as
   sometimes it is copied to/from the propagated input files.

 - `local fd` should ensure that file descriptors aren't clobbered
   during recursion.
parent f385e224
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -275,9 +275,9 @@ 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
      printLines ${cc} ${cc.man or ""} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages

      echo ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
      printLines ${toString extraPackages} > $out/nix-support/propagated-native-build-inputs
    ''

    + optionalString (targetPlatform.isSunOS && nativePrefix != "") ''
+1 −1
Original line number Diff line number Diff line
@@ -211,5 +211,5 @@ cp -p $utils $out/nix-support/utils.sh
# tools like gcov, the manpages, etc. as well (including for binutils
# and Glibc).
if test -z "$nativeTools"; then
    echo $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages
    printLines $gcc $binutils $libc $libc_bin > $out/nix-support/propagated-user-env-packages
fi
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ _multioutPropagateDev() {

    mkdir -p "${!propagaterOutput}"/nix-support
    for output in $propagatedBuildOutputs; do
        echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/$propagatedBuildInputsFile
        echo "${!output}" >> "${!propagaterOutput}"/nix-support/$propagatedBuildInputsFile
    done
}
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ rec {
        mkdir -p $out/nix-support
        cp ${script} $out/nix-support/setup-hook
      '' + lib.optionalString (deps != []) ''
        echo ${toString deps} > $out/nix-support/propagated-native-build-inputs
        printLines ${toString deps} > $out/nix-support/propagated-native-build-inputs
      '' + lib.optionalString (substitutions != {}) ''
        substituteAll ${script} $out/nix-support/setup-hook
      '');
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ rec {
       };})
        ''
          mkdir -pv $out/nix-support
          echo "${toString list}" | tee $out/nix-support/propagated-user-env-packages
          printLines ${toString list} | tee $out/nix-support/propagated-user-env-packages
        '';

  # Given manifest module data, return the module
Loading