Store the final drv outputs in memory when building remotely

The `DerivationGoal` has a variable storing the “final” derivation
output paths that is used (amongst other things) to fill the environment
for the post build hook. However this variable wasn't set when the
build-hook is used, causing a crash when both hooks are used together.

Fix this by setting this variable (from the informations in the db) after a run
of the post build hook.
This commit is contained in:
regnat 2020-12-09 10:38:04 +01:00
parent ee7c94fa1b
commit c87267c2a4

View file

@ -2872,6 +2872,8 @@ void DerivationGoal::registerOutputs()
for (auto & i : drv->outputsAndOptPaths(worker.store)) {
if (!i.second.second || !worker.store.isValidPath(*i.second.second))
allValid = false;
else
finalOutputs.insert_or_assign(i.first, *i.second.second);
}
if (allValid) return;
}