File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -182,8 +182,16 @@ Goal::Co DerivationGoal::haveDerivation()
182182 }
183183 }
184184
185- if (buildResult.success ())
186- assert (buildResult.builtOutputs .count (wantedOutput) > 0 );
185+ if (buildResult.success ()) {
186+ /* If the wanted output is not in builtOutputs (e.g., because it
187+ was already valid and therefore not re-registered), we need to
188+ add it ourselves to ensure we return the correct information. */
189+ if (buildResult.builtOutputs .count (wantedOutput) == 0 ) {
190+ debug (
191+ " BUG! wanted output '%s' not in builtOutputs, working around by adding it manually" , wantedOutput);
192+ buildResult.builtOutputs = {{wantedOutput, assertPathValidity ()}};
193+ }
194+ }
187195 }
188196
189197 co_return amDone (g->exitCode , g->ex );
You can’t perform that action at this time.
0 commit comments