File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments