diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 94f94aaffe32..1a749d2c8476 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -320,9 +320,10 @@ attributes can also be used: variable `buildAndTestSubdir` can be used to build a crate in a Cargo workspace. Additional maturin flags can be passed through `maturinBuildFlags`. -* `cargoCheckHook`: run tests using Cargo. Additional flags can be - passed to Cargo using `checkFlags` and `checkFlagsArray`. By - default, tests are run in parallel. This can be disabled by setting +* `cargoCheckHook`: run tests using Cargo. The build type for checks + can be set using `cargoCheckType`. Additional flags can be passed to + the tests using `checkFlags` and `checkFlagsArray`. By default, + tests are run in parallel. This can be disabled by setting `dontUseCargoParallelTests`. * `cargoInstallHook`: install binaries and static/shared libraries that were built using `cargoBuildHook`. diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index bfa6c0d17cd6..ff9ca642daad 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -103,6 +103,8 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // lib.optionalAttrs u cargoBuildType = buildType; + cargoCheckType = checkType; + patchRegistryDeps = ./patch-registry-deps; nativeBuildInputs = nativeBuildInputs ++ [ diff --git a/pkgs/build-support/rust/hooks/cargo-check-hook.sh b/pkgs/build-support/rust/hooks/cargo-check-hook.sh index 8c5b1a13219a..82e669af3a08 100644 --- a/pkgs/build-support/rust/hooks/cargo-check-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-check-hook.sh @@ -15,7 +15,7 @@ cargoCheckHook() { threads=1 fi - argstr="--${cargoBuildType} --target @rustTargetPlatformSpec@ --frozen"; + argstr="--${cargoCheckType} --target @rustTargetPlatformSpec@ --frozen"; ( set -x