buildRustPackage: Avoid altering `.cargo/config` in source

wip/yesman
Atkins 5 years ago committed by Jörg Thalheim
parent b53e237ef6
commit 626ccd7121
No known key found for this signature in database
GPG Key ID: B3F5D81B0C6967C4
  1. 15
      pkgs/build-support/rust/default.nix

@ -72,14 +72,6 @@ in stdenv.mkDerivation (args // {
substitute $config .cargo/config \
--subst-var-by vendor "$(pwd)/$cargoDepsCopy"
unset cargoDepsCopy
export RUST_LOG=${logLevel}
'' + (args.postUnpack or "");
configurePhase = args.configurePhase or ''
runHook preConfigure
mkdir -p .cargo
cat >> .cargo/config <<'EOF'
[target."${stdenv.buildPlatform.config}"]
"linker" = "${ccForBuild}"
@ -89,6 +81,13 @@ in stdenv.mkDerivation (args // {
''}
EOF
cat .cargo/config
unset cargoDepsCopy
export RUST_LOG=${logLevel}
'' + (args.postUnpack or "");
configurePhase = args.configurePhase or ''
runHook preConfigure
runHook postConfigure
'';

Loading…
Cancel
Save