mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 11:36:03 +01:00
Merge pull request #14430 from NixOS/backport-14137-to-2.32-maintenance
[Backport 2.32-maintenance] fix(libstore/build/derivation-goal): don't assert on partially valid outputs
This commit is contained in:
commit
e6003b5c4f
1 changed files with 13 additions and 1 deletions
|
|
@ -182,7 +182,19 @@ Goal::Co DerivationGoal::haveDerivation()
|
|||
}
|
||||
}
|
||||
|
||||
assert(success.builtOutputs.count(wantedOutput) > 0);
|
||||
/* If the wanted output is not in builtOutputs (e.g., because it
|
||||
was already valid and therefore not re-registered), we need to
|
||||
add it ourselves to ensure we return the correct information. */
|
||||
if (success.builtOutputs.count(wantedOutput) == 0) {
|
||||
debug(
|
||||
"BUG! wanted output '%s' not in builtOutputs, working around by adding it manually", wantedOutput);
|
||||
auto realisation = assertPathValidity();
|
||||
realisation.id = DrvOutput{
|
||||
.drvHash = outputHash,
|
||||
.outputName = wantedOutput,
|
||||
};
|
||||
success.builtOutputs.emplace(wantedOutput, std::move(realisation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue