1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

Merge pull request #13294 from obsidiansystems/fix-13293

Fix #13293
This commit is contained in:
John Ericson 2025-06-11 16:55:43 -04:00 committed by GitHub
commit 371fcf91c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 14 deletions

View file

@ -613,9 +613,6 @@ Goal::Co DerivationBuildingGoal::tryToBuild()
void closeLogFile() override {
goal.closeLogFile();
}
SingleDrvOutputs assertPathValidity() override {
return goal.assertPathValidity();
}
void appendLogTailErrorMsg(std::string & msg) override {
goal.appendLogTailErrorMsg(msg);
}

View file

@ -210,6 +210,13 @@ Goal::Co DerivationGoal::haveDerivation(StorePath drvPath)
.outputs = wantedOutputs,
});
if (buildMode == bmCheck) {
/* In checking mode, the builder will not register any outputs.
So we want to make sure the ones that we wanted to check are
properly there. */
buildResult.builtOutputs = assertPathValidity(drvPath);
}
co_return amDone(g->exitCode, g->ex);
};

View file

@ -1871,7 +1871,7 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
also a source for non-determinism. */
if (delayedException)
std::rethrow_exception(delayedException);
return miscMethods->assertPathValidity();
return {};
}
/* Apply output checks. */

View file

@ -97,14 +97,6 @@ struct DerivationBuilderCallbacks
*/
virtual void closeLogFile() = 0;
/**
* Aborts if any output is not valid or corrupt, and otherwise
* returns a 'SingleDrvOutputs' structure containing all outputs.
*
* @todo Probably should just be in `DerivationGoal`.
*/
virtual SingleDrvOutputs assertPathValidity() = 0;
virtual void appendLogTailErrorMsg(std::string & msg) = 0;
/**

View file

@ -22,6 +22,11 @@ clearStore
nix-build dependencies.nix --no-out-link
nix-build dependencies.nix --no-out-link --check
# Make sure checking just one output works (#13293)
nix-build multiple-outputs.nix -A a --no-out-link
nix-store --delete "$(nix-build multiple-outputs.nix -A a.second --no-out-link)"
nix-build multiple-outputs.nix -A a.first --no-out-link --check
# Build failure exit codes (100, 104, etc.) are from
# doc/manual/source/command-ref/status-build-failure.md