Skip to content

Commit 4a2fb18

Browse files
authored
Merge pull request #14137 from lovesegfault/nix-debug-14130
fix(libstore/build/derivation-goal): don't assert on partially valid outputs
2 parents 37c1ef5 + 9eecee3 commit 4a2fb18

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/libstore/build/derivation-goal.cc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,23 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation)
278278
}
279279
}
280280

281-
assert(success.builtOutputs.count(wantedOutput) > 0);
281+
/* If the wanted output is not in builtOutputs (e.g., because it
282+
was already valid and therefore not re-registered), we need to
283+
add it ourselves to ensure we return the correct information. */
284+
if (success.builtOutputs.count(wantedOutput) == 0) {
285+
debug(
286+
"BUG! wanted output '%s' not in builtOutputs, working around by adding it manually", wantedOutput);
287+
success.builtOutputs = {{
288+
wantedOutput,
289+
{
290+
assertPathValidity(),
291+
{
292+
.drvHash = outputHash,
293+
.outputName = wantedOutput,
294+
},
295+
},
296+
}};
297+
}
282298
}
283299
}
284300

0 commit comments

Comments
 (0)