1 # shellcheck shell=bash disable=SC2154,SC2164
4 echo "Executing cargoCheckHook"
8 if [[ -n "${buildAndTestSubdir-}" ]]; then
9 pushd "${buildAndTestSubdir}"
12 local flagsArray
=("-j" "$NIX_BUILD_CORES")
14 if [[ -z ${dontUseCargoParallelTests-} ]]; then
15 prependToVar checkFlags
"--test-threads=$NIX_BUILD_CORES"
17 prependToVar checkFlags
"--test-threads=1"
20 if [ "${cargoCheckType}" != "debug" ]; then
21 flagsArray
+=("--profile" "${cargoCheckType}")
24 if [ -n "${cargoCheckNoDefaultFeatures-}" ]; then
25 flagsArray
+=("--no-default-features")
28 if [ -n "${cargoCheckFeatures-}" ]; then
29 flagsArray
+=("--features=$(concatStringsSep "," cargoCheckFeatures)")
33 "--target" "@rustHostPlatformSpec@"
37 prependToVar checkFlags
"--"
38 concatTo flagsArray cargoTestFlags checkFlags checkFlagsArray
40 echoCmd
'cargoCheckHook flags' "${flagsArray[@]}"
41 @setEnv@ cargo
test "${flagsArray[@]}"
43 if [[ -n "${buildAndTestSubdir-}" ]]; then
47 echo "Finished cargoCheckHook"
52 if [ -z "${dontCargoCheck-}" ] && [ -z "${checkPhase-}" ]; then
53 checkPhase
=cargoCheckHook