diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 476f29238..b673153a3 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -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; diff --git a/src/libstore/build/derivation-goal.hh b/src/libstore/build/derivation-goal.hh index 177892996..84d425b95 100644 --- a/src/libstore/build/derivation-goal.hh +++ b/src/libstore/build/derivation-goal.hh @@ -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. */ diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index 91dc85fdc..659ac1b10 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -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 infos; diff --git a/src/libstore/unix/build/local-derivation-goal.hh b/src/libstore/unix/build/local-derivation-goal.hh index 67d544b65..6bd3ce45f 100644 --- a/src/libstore/unix/build/local-derivation-goal.hh +++ b/src/libstore/unix/build/local-derivation-goal.hh @@ -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;