Skip to content

Commit de19279

Browse files
Ericson2314edolstra
andcommitted
Fix issue #14287
The test added in the previous commit now passes. Co-authored-by: Eelco Dolstra <[email protected]>
1 parent 246dbe1 commit de19279

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/libstore/build/derivation-building-goal.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,15 @@ Goal::Co DerivationBuildingGoal::tryToBuild()
677677
{
678678
builder.reset();
679679
StorePathSet outputPaths;
680-
for (auto & [_, output] : builtOutputs) {
680+
/* In the check case we install no store objects, and so
681+
`builtOutputs` is empty. However, per issue #14287, there is
682+
an expectation that the post-build hook is still executed.
683+
(This is useful for e.g. logging successful deterministic rebuilds.)
684+
685+
In order to make that work, in the check case just load the
686+
(preexisting) infos from scratch, rather than relying on what
687+
`DerivationBuilder` returned to us. */
688+
for (auto & [_, output] : buildMode == bmCheck ? checkPathValidity(initialOutputs).second : builtOutputs) {
681689
// for sake of `bmRepair`
682690
worker.markContentsGood(output.outPath);
683691
outputPaths.insert(output.outPath);

0 commit comments

Comments
 (0)