DerivationBuilder Change missing initialOutput if..throw to assert
Since this goal has no (goal-wide) notion of "wanted outputs" (we're building the derivation, and thus making all outputs), we should have `initialOutputs` for all outputs, and if we're missing one that's an internal error caused by a bug in Nix. Concretely, `DerivationBuildingGoal::gaveUpOnSubstitution` now clearly does create `initialOutputs` for all outputs, whereas a few commits ago that was not obvious, so I feel confident in saying that this invariant that should be upheld, in fact is upheld. `scatchOutputs` is initialized for every initial output, so the same change to it follows for the same reasons.
This commit is contained in:
@@ -1456,18 +1456,14 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||
std::map<std::string, struct stat> outputStats;
|
||||
for (auto & [outputName, _] : drv.outputs) {
|
||||
auto scratchOutput = get(scratchOutputs, outputName);
|
||||
if (!scratchOutput)
|
||||
throw BuildError(
|
||||
"builder for '%s' has no scratch output for '%s'", store.printStorePath(drvPath), outputName);
|
||||
assert(scratchOutput);
|
||||
auto actualPath = realPathInSandbox(store.printStorePath(*scratchOutput));
|
||||
|
||||
outputsToSort.insert(outputName);
|
||||
|
||||
/* Updated wanted info to remove the outputs we definitely don't need to register */
|
||||
auto initialOutput = get(initialOutputs, outputName);
|
||||
if (!initialOutput)
|
||||
throw BuildError(
|
||||
"builder for '%s' has no initial output for '%s'", store.printStorePath(drvPath), outputName);
|
||||
assert(initialOutput);
|
||||
auto & initialInfo = *initialOutput;
|
||||
|
||||
/* Don't register if already valid, and not checking */
|
||||
|
||||
Reference in New Issue
Block a user