summary refs log tree commit diff
path: root/pkgs/build-support/rust
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-11-26 15:00:16 +0000
committerJörg Thalheim <joerg@thalheim.io>2018-11-26 15:00:16 +0000
commitdc8aca448d0570ade231f92272c4453bc9837fc9 (patch)
tree65302c89779e1fb505acb6aaff0633dfbc11230a /pkgs/build-support/rust
parent7b63cdcc077b3c86faa7245daae9398075ae3d01 (diff)
parent8d4fbc55d839374090fbf45250d40e18e12b4e48 (diff)
downloadnixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.tar
nixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.tar.gz
nixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.tar.bz2
nixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.tar.lz
nixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.tar.xz
nixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.tar.zst
nixpkgs-dc8aca448d0570ade231f92272c4453bc9837fc9.zip
Merge pull request #51028 from clefru/tmp-cargo-config
buildRustPackage: write cargo config to temporary file instead of source dir
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r--pkgs/build-support/rust/fetchcargo.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/build-support/rust/fetchcargo.nix b/pkgs/build-support/rust/fetchcargo.nix
index c23fa66ef9f..13d52e38337 100644
--- a/pkgs/build-support/rust/fetchcargo.nix
+++ b/pkgs/build-support/rust/fetchcargo.nix
@@ -38,18 +38,19 @@ stdenv.mkDerivation {
     fi
 
     export CARGO_HOME=$(mktemp -d cargo-home.XXX)
+    CARGO_CONFIG=$(mktemp cargo-config.XXXX)
 
     ${cargoUpdateHook}
 
     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
     # and instead hardcode the config in ./fetchcargo-default-config.toml.
     # 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,
     # we don't store the config.
-    if ! cmp config ${./fetchcargo-default-config.toml} > /dev/null; then
-      install -Dt $out/.cargo config;
+    if ! cmp $CARGO_CONFIG ${./fetchcargo-default-config.toml} > /dev/null; then
+      install -Dt $out/.cargo $CARGO_CONFIG;
     fi;
   '';