1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-29 13:41:00 +01:00

Restore dynamic derivations!

This method does *not* create a new type of goal. We instead just make
`DerivationGoal` more sophisticated, which is much easier to do now that
`DerivationBuildingGoal` has been split from it (and so many fields are
gone, or or local variables instead).

This avoids the need for a secondarily trampoline goal that interacted
poorly with `addWantedOutputs`. That, I hope, will mean the bugs from
before do not reappear.

There may in fact be a reason to introduce such a trampoline in the
future, but it would only happen in conjunction with getting rid of
`addWantedOutputs`.

Restores the functionality (and tests) that was reverted in
f4f28cdd0e.
This commit is contained in:
John Ericson 2025-05-14 13:35:37 -04:00
parent bf5d544d3b
commit 57348b677b
12 changed files with 145 additions and 77 deletions

View file

@ -296,7 +296,7 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution()
// FIXME wanted outputs
auto resolvedDrvGoal = worker.makeDerivationGoal(
pathResolved, OutputsSpec::All{}, buildMode);
makeConstantStorePathRef(pathResolved), OutputsSpec::All{}, buildMode);
{
Goals waitees{resolvedDrvGoal};
co_await await(std::move(waitees));
@ -338,7 +338,7 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution()
throw Error(
"derivation '%s' doesn't have expected output '%s' (derivation-goal.cc/realisation)",
worker.store.printStorePath(resolvedDrvGoal->drvPath), outputName);
resolvedDrvGoal->drvReq->to_string(worker.store), outputName);
}();
if (!drv->type().isImpure()) {