Skip to content

Commit 683f97e

Browse files
lolbinarycatalyssais
authored andcommitted
rustPlatform: cargo test is now called with the same environment variables as cargo build
this means that cargo dependancies will no longer be built twice.
1 parent 4b2bd47 commit 683f97e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkgs/build-support/rust/hooks/cargo-check-hook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cargoCheckHook() {
3838
concatTo flagsArray cargoTestFlags checkFlags checkFlagsArray
3939

4040
echoCmd 'cargoCheckHook flags' "${flagsArray[@]}"
41-
cargo test "${flagsArray[@]}"
41+
@setEnv@ cargo test "${flagsArray[@]}"
4242

4343
if [[ -n "${buildAndTestSubdir-}" ]]; then
4444
popd

pkgs/build-support/rust/hooks/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
name = "cargo-check-hook.sh";
3232
propagatedBuildInputs = [ cargo ];
3333
substitutions = {
34-
inherit (rust.envVars) rustHostPlatformSpec;
34+
inherit (rust.envVars) rustHostPlatformSpec setEnv;
3535
};
3636
} ./cargo-check-hook.sh) {};
3737

0 commit comments

Comments
 (0)