Merge pull request #51028 from clefru/tmp-cargo-config
buildRustPackage: write cargo config to temporary file instead of source dir
This commit is contained in:
commit
dc8aca448d
@ -38,18 +38,19 @@ stdenv.mkDerivation {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
||||||
|
CARGO_CONFIG=$(mktemp cargo-config.XXXX)
|
||||||
|
|
||||||
${cargoUpdateHook}
|
${cargoUpdateHook}
|
||||||
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cargo vendor $out | cargo-vendor-normalise > config
|
cargo vendor $out | cargo-vendor-normalise > $CARGO_CONFIG
|
||||||
# fetchcargo used to never keep the config output by cargo vendor
|
# fetchcargo used to never keep the config output by cargo vendor
|
||||||
# and instead hardcode the config in ./fetchcargo-default-config.toml.
|
# and instead hardcode the config in ./fetchcargo-default-config.toml.
|
||||||
# This broke on packages needing git dependencies, so now we keep the config.
|
# This broke on packages needing git dependencies, so now we keep the config.
|
||||||
# But not to break old cargoSha256, if the previous behavior was enough,
|
# But not to break old cargoSha256, if the previous behavior was enough,
|
||||||
# we don't store the config.
|
# we don't store the config.
|
||||||
if ! cmp config ${./fetchcargo-default-config.toml} > /dev/null; then
|
if ! cmp $CARGO_CONFIG ${./fetchcargo-default-config.toml} > /dev/null; then
|
||||||
install -Dt $out/.cargo config;
|
install -Dt $out/.cargo $CARGO_CONFIG;
|
||||||
fi;
|
fi;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user