Skip to content

Commit 0e7e1f5

Browse files
L-asEricson2314
authored andcommitted
Remove registerOutputs from drv goal
Easy to inline in one spot, and assert in the other.
1 parent a87589a commit 0e7e1f5

File tree

4 files changed

+11
-29
lines changed

4 files changed

+11
-29
lines changed

src/libstore/build/derivation-goal.cc

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,15 @@ Goal::Co DerivationGoal::hookDone()
945945

946946
/* Compute the FS closure of the outputs and register them as
947947
being valid. */
948-
auto builtOutputs = registerOutputs();
948+
auto builtOutputs =
949+
/* When using a build hook, the build hook can register the output
950+
as valid (by doing `nix-store --import'). If so we don't have
951+
to do anything here.
952+
953+
We can only early return when the outputs are known a priori. For
954+
floating content-addressing derivations this isn't the case.
955+
*/
956+
assertPathValidity();
949957

950958
StorePathSet outputPaths;
951959
for (auto & [_, output] : builtOutputs)
@@ -1174,18 +1182,6 @@ HookReply DerivationGoal::tryBuildHook()
11741182
}
11751183

11761184

1177-
SingleDrvOutputs DerivationGoal::registerOutputs()
1178-
{
1179-
/* When using a build hook, the build hook can register the output
1180-
as valid (by doing `nix-store --import'). If so we don't have
1181-
to do anything here.
1182-
1183-
We can only early return when the outputs are known a priori. For
1184-
floating content-addressing derivations this isn't the case.
1185-
*/
1186-
return assertPathValidity();
1187-
}
1188-
11891185
Path DerivationGoal::openLogFile()
11901186
{
11911187
logSize = 0;

src/libstore/build/derivation-goal.hh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,6 @@ struct DerivationGoal : public Goal
262262
*/
263263
HookReply tryBuildHook();
264264

265-
/**
266-
* Check that the derivation outputs all exist and register them
267-
* as valid.
268-
*/
269-
virtual SingleDrvOutputs registerOutputs();
270-
271265
/**
272266
* Open a log file and a pipe to it.
273267
*/

src/libstore/unix/build/local-derivation-goal.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,15 +2330,7 @@ void LocalDerivationGoal::runChild()
23302330

23312331
SingleDrvOutputs LocalDerivationGoal::registerOutputs()
23322332
{
2333-
/* When using a build hook, the build hook can register the output
2334-
as valid (by doing `nix-store --import'). If so we don't have
2335-
to do anything here.
2336-
2337-
We can only early return when the outputs are known a priori. For
2338-
floating content-addressing derivations this isn't the case.
2339-
*/
2340-
if (hook)
2341-
return DerivationGoal::registerOutputs();
2333+
assert(!hook);
23422334

23432335
std::map<std::string, ValidPathInfo> infos;
23442336

src/libstore/unix/build/local-derivation-goal.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct LocalDerivationGoal : public DerivationGoal
239239
* Check that the derivation outputs all exist and register them
240240
* as valid.
241241
*/
242-
SingleDrvOutputs registerOutputs() override;
242+
SingleDrvOutputs registerOutputs();
243243

244244
void signRealisation(Realisation &) override;
245245

0 commit comments

Comments
 (0)