Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #218472 from figsoda/cargo-setup

authored by figsoda and committed by GitHub eedbf71d f3b63ce3

+7 -1
+7 -1
pkgs/build-support/rust/hooks/cargo-setup-hook.sh
··· 6 # it writable. If we're using a tarball, the unpackFile hook already handles 7 # this for us automatically. 8 if [ -z $cargoVendorDir ]; then 9 - unpackFile "$cargoDeps" 10 export cargoDepsCopy="$(realpath "$(stripHash $cargoDeps)")" 11 else 12 cargoDepsCopy="$(realpath "$(pwd)/$sourceRoot/${cargoRoot:+$cargoRoot/}${cargoVendorDir}")"
··· 6 # it writable. If we're using a tarball, the unpackFile hook already handles 7 # this for us automatically. 8 if [ -z $cargoVendorDir ]; then 9 + if [ -d "$cargoDeps" ]; then 10 + local dest=$(stripHash "$cargoDeps") 11 + cp -Lr --reflink=auto -- "$cargoDeps" "$dest" 12 + chmod -R +644 -- "$dest" 13 + else 14 + unpackFile "$cargoDeps" 15 + fi 16 export cargoDepsCopy="$(realpath "$(stripHash $cargoDeps)")" 17 else 18 cargoDepsCopy="$(realpath "$(pwd)/$sourceRoot/${cargoRoot:+$cargoRoot/}${cargoVendorDir}")"