1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 11:36:03 +01:00
The test added in the previous commit now passes.

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
(cherry picked from commit de192794c9)
This commit is contained in:
John Ericson 2025-10-17 13:07:41 -04:00 committed by github-actions[bot]
parent 328a3bbbd0
commit 9e4177bc67

View file

@ -860,7 +860,15 @@ Goal::Co DerivationBuildingGoal::tryToBuild()
{ {
builder.reset(); builder.reset();
StorePathSet outputPaths; StorePathSet outputPaths;
for (auto & [_, output] : builtOutputs) { /* In the check case we install no store objects, and so
`builtOutputs` is empty. However, per issue #14287, there is
an expectation that the post-build hook is still executed.
(This is useful for e.g. logging successful deterministic rebuilds.)
In order to make that work, in the check case just load the
(preexisting) infos from scratch, rather than relying on what
`DerivationBuilder` returned to us. */
for (auto & [_, output] : buildMode == bmCheck ? checkPathValidity(initialOutputs).second : builtOutputs) {
// for sake of `bmRepair` // for sake of `bmRepair`
worker.markContentsGood(output.outPath); worker.markContentsGood(output.outPath);
outputPaths.insert(output.outPath); outputPaths.insert(output.outPath);