1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 14:21:48 +02:00

Remove registerOutputs from drv goal

Easy to inline in one spot, and assert in the other.
This commit is contained in:
Las 2025-03-10 23:15:59 +00:00 committed by John Ericson
parent a87589a035
commit 0e7e1f5b57
4 changed files with 11 additions and 29 deletions

View file

@ -945,7 +945,15 @@ Goal::Co DerivationGoal::hookDone()
/* Compute the FS closure of the outputs and register them as
being valid. */
auto builtOutputs = registerOutputs();
auto builtOutputs =
/* When using a build hook, the build hook can register the output
as valid (by doing `nix-store --import'). If so we don't have
to do anything here.
We can only early return when the outputs are known a priori. For
floating content-addressing derivations this isn't the case.
*/
assertPathValidity();
StorePathSet outputPaths;
for (auto & [_, output] : builtOutputs)
@ -1174,18 +1182,6 @@ HookReply DerivationGoal::tryBuildHook()
}
SingleDrvOutputs DerivationGoal::registerOutputs()
{
/* When using a build hook, the build hook can register the output
as valid (by doing `nix-store --import'). If so we don't have
to do anything here.
We can only early return when the outputs are known a priori. For
floating content-addressing derivations this isn't the case.
*/
return assertPathValidity();
}
Path DerivationGoal::openLogFile()
{
logSize = 0;

View file

@ -262,12 +262,6 @@ struct DerivationGoal : public Goal
*/
HookReply tryBuildHook();
/**
* Check that the derivation outputs all exist and register them
* as valid.
*/
virtual SingleDrvOutputs registerOutputs();
/**
* Open a log file and a pipe to it.
*/

View file

@ -2330,15 +2330,7 @@ void LocalDerivationGoal::runChild()
SingleDrvOutputs LocalDerivationGoal::registerOutputs()
{
/* When using a build hook, the build hook can register the output
as valid (by doing `nix-store --import'). If so we don't have
to do anything here.
We can only early return when the outputs are known a priori. For
floating content-addressing derivations this isn't the case.
*/
if (hook)
return DerivationGoal::registerOutputs();
assert(!hook);
std::map<std::string, ValidPathInfo> infos;

View file

@ -239,7 +239,7 @@ struct LocalDerivationGoal : public DerivationGoal
* Check that the derivation outputs all exist and register them
* as valid.
*/
SingleDrvOutputs registerOutputs() override;
SingleDrvOutputs registerOutputs();
void signRealisation(Realisation &) override;