Skip to content

Commit 692074f

Browse files
committed
Use Worker::makeDerivationGoal less
We're about to split up `DerivationGoal` a bit. At that point `makeDerivationGoal` will mean something more specific than it does today. (Perhaps a future rename will make this clearer.) On the other hand, the more public `Worker::makeGoal` function will continue to work exactly as before. So by moving some call sites to use that instead, we preemptively avoid issues in the next step.
1 parent 1c4caef commit 692074f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/libstore/build/derivation-goal.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,12 @@ void DerivationGoal::gaveUpOnSubstitution()
380380
worker.store.printStorePath(i.first));
381381
}
382382

383-
addWaitee(worker.makeDerivationGoal(i.first, i.second, buildMode == bmRepair ? bmRepair : bmNormal));
383+
addWaitee(worker.makeGoal(
384+
DerivedPath::Built {
385+
.drvPath = makeConstantStorePathRef(i.first),
386+
.outputs = i.second,
387+
},
388+
buildMode == bmRepair ? bmRepair : bmNormal));
384389
}
385390

386391
/* Copy the input sources from the eval store to the build
@@ -452,7 +457,12 @@ void DerivationGoal::repairClosure()
452457
if (drvPath2 == outputsToDrv.end())
453458
addWaitee(upcast_goal(worker.makePathSubstitutionGoal(i, Repair)));
454459
else
455-
addWaitee(worker.makeDerivationGoal(drvPath2->second, OutputsSpec::All(), bmRepair));
460+
addWaitee(worker.makeGoal(
461+
DerivedPath::Built {
462+
.drvPath = makeConstantStorePathRef(drvPath2->second),
463+
.outputs = OutputsSpec::All { },
464+
},
465+
bmRepair));
456466
}
457467

458468
if (waitees.empty()) {

src/libstore/build/entry-points.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ void Store::repairPath(const StorePath & path)
124124
auto info = queryPathInfo(path);
125125
if (info->deriver && isValidPath(*info->deriver)) {
126126
goals.clear();
127-
// FIXME: Should just build the specific output we need.
128-
goals.insert(worker.makeDerivationGoal(*info->deriver, OutputsSpec::All { }, bmRepair));
127+
goals.insert(worker.makeGoal(DerivedPath::Built {
128+
.drvPath = makeConstantStorePathRef(*info->deriver),
129+
// FIXME: Should just build the specific output we need.
130+
.outputs = OutputsSpec::All { },
131+
}, bmRepair));
129132
worker.run(goals);
130133
} else
131134
throw Error(worker.failingExitStatus(), "cannot repair path '%s'", printStorePath(path));

0 commit comments

Comments
 (0)