lol

stdenv/freebsd: isolate bootstrap process more

Copying instead of symlinking prevents leakage of the bootstrap FHS
into the 0->1 bootstrap stage. The symptom this addresses is libssh2
failing because it can't find libssl, since it is failing to use the
ld wrapper.

+8 -1
+3
pkgs/stdenv/freebsd/default.nix
··· 62 62 name = attrs.name or (builtins.baseNameOf (builtins.elemAt attrs.paths 0)); 63 63 src = bootstrapArchive; 64 64 builder = "${bootstrapArchive}/bin/bash"; 65 + # this script will prefer to link files instead of copying them. 66 + # this prevents clang in particular, but possibly others, from calling readlink(argv[0]) 67 + # and obtaining dependencies, ld(1) in particular, from there instead of $PATH. 65 68 args = [ ./linkBootstrap.sh ]; 66 69 PATH = "${bootstrapArchive}/bin"; 67 70 paths = attrs.paths;
+5 -1
pkgs/stdenv/freebsd/linkBootstrap.sh
··· 6 6 exit 1 7 7 fi 8 8 mkdir -p $out/$(dirname $path) 9 - ln -s $src/$path $out/$path 9 + if [[ -d $src/$path ]]; then 10 + ln -s $src/$path $out/$path 11 + else 12 + cp -RL $src/$path $out/$path 13 + fi 10 14 done