mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-19 11:00:19 +03:00
rustPlatform.cargoSetupHook: dereference symlinks in cargoDeps
unpackFile doesn't dereference symlinks if cargoDeps is a directory, and some cargo builds run into permission issues because the files the symlinks point to are not writable.
This commit is contained in:
parent
e5fb0c0c72
commit
3e18607be3
@ -8,7 +8,13 @@ cargoSetupPostUnpackHook() {
|
||||
# it writable. If we're using a tarball, the unpackFile hook already handles
|
||||
# this for us automatically.
|
||||
if [ -z $cargoVendorDir ]; then
|
||||
unpackFile "$cargoDeps"
|
||||
if [ -d "$cargoDeps" ]; then
|
||||
local dest=$(stripHash "$cargoDeps")
|
||||
cp -Lr --reflink=auto -- "$cargoDeps" "$dest"
|
||||
chmod -R +644 -- "$dest"
|
||||
else
|
||||
unpackFile "$cargoDeps"
|
||||
fi
|
||||
export cargoDepsCopy="$(realpath "$(stripHash $cargoDeps)")"
|
||||
else
|
||||
cargoDepsCopy="$(realpath "$(pwd)/$sourceRoot/${cargoRoot:+$cargoRoot/}${cargoVendorDir}")"
|
||||
|
Loading…
Reference in New Issue
Block a user