forked from lix-project/lix
Merge pull request #6850 from NinjaTrappeur/nin/build-check
Fix Nix build --check flag
This commit is contained in:
commit
8f3fdef1e0
|
@ -913,12 +913,6 @@ void DerivationGoal::buildDone()
|
||||||
outputPaths
|
outputPaths
|
||||||
);
|
);
|
||||||
|
|
||||||
if (buildMode == bmCheck) {
|
|
||||||
cleanupPostOutputsRegisteredModeCheck();
|
|
||||||
done(BuildResult::Built, std::move(builtOutputs));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanupPostOutputsRegisteredModeNonCheck();
|
cleanupPostOutputsRegisteredModeNonCheck();
|
||||||
|
|
||||||
/* Repeat the build if necessary. */
|
/* Repeat the build if necessary. */
|
||||||
|
|
|
@ -40,6 +40,14 @@ nix-build check.nix -A deterministic --argstr checkBuildId $checkBuildId \
|
||||||
if grep -q 'may not be deterministic' $TEST_ROOT/log; then false; fi
|
if grep -q 'may not be deterministic' $TEST_ROOT/log; then false; fi
|
||||||
checkBuildTempDirRemoved $TEST_ROOT/log
|
checkBuildTempDirRemoved $TEST_ROOT/log
|
||||||
|
|
||||||
|
nix build -f check.nix deterministic --rebuild --repeat 1 \
|
||||||
|
--argstr checkBuildId $checkBuildId --keep-failed --no-link \
|
||||||
|
2> $TEST_ROOT/log
|
||||||
|
if grep -q 'checking is not possible' $TEST_ROOT/log; then false; fi
|
||||||
|
# Repeat is set to 1, ie. nix should build deterministic twice.
|
||||||
|
if [ "$(grep "checking outputs" $TEST_ROOT/log | wc -l)" -ne 2 ]; then false; fi
|
||||||
|
checkBuildTempDirRemoved $TEST_ROOT/log
|
||||||
|
|
||||||
nix-build check.nix -A nondeterministic --argstr checkBuildId $checkBuildId \
|
nix-build check.nix -A nondeterministic --argstr checkBuildId $checkBuildId \
|
||||||
--no-out-link 2> $TEST_ROOT/log
|
--no-out-link 2> $TEST_ROOT/log
|
||||||
checkBuildTempDirRemoved $TEST_ROOT/log
|
checkBuildTempDirRemoved $TEST_ROOT/log
|
||||||
|
@ -50,6 +58,12 @@ grep 'may not be deterministic' $TEST_ROOT/log
|
||||||
[ "$status" = "104" ]
|
[ "$status" = "104" ]
|
||||||
checkBuildTempDirRemoved $TEST_ROOT/log
|
checkBuildTempDirRemoved $TEST_ROOT/log
|
||||||
|
|
||||||
|
nix build -f check.nix nondeterministic --rebuild --repeat 1 \
|
||||||
|
--argstr checkBuildId $checkBuildId --keep-failed --no-link \
|
||||||
|
2> $TEST_ROOT/log || status=$?
|
||||||
|
grep 'may not be deterministic' $TEST_ROOT/log
|
||||||
|
checkBuildTempDirRemoved $TEST_ROOT/log
|
||||||
|
|
||||||
nix-build check.nix -A nondeterministic --argstr checkBuildId $checkBuildId \
|
nix-build check.nix -A nondeterministic --argstr checkBuildId $checkBuildId \
|
||||||
--no-out-link --check --keep-failed 2> $TEST_ROOT/log || status=$?
|
--no-out-link --check --keep-failed 2> $TEST_ROOT/log || status=$?
|
||||||
grep 'may not be deterministic' $TEST_ROOT/log
|
grep 'may not be deterministic' $TEST_ROOT/log
|
||||||
|
|
Loading…
Reference in a new issue