Skip to content

Commit a543519

Browse files
authored
Merge pull request #14257 from obsidiansystems/misc-builder-tech-debt
Cleanup misc builder tech debt
2 parents 5700112 + 632ccfb commit a543519

File tree

5 files changed

+6
-20
lines changed

5 files changed

+6
-20
lines changed

src/libstore/build/derivation-goal.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation)
100100
them. */
101101
if (settings.useSubstitutes && drvOptions.substitutesAllowed()) {
102102
if (!checkResult)
103-
waitees.insert(upcast_goal(worker.makeDrvOutputSubstitutionGoal(
104-
DrvOutput{outputHash, wantedOutput}, buildMode == bmRepair ? Repair : NoRepair)));
103+
waitees.insert(upcast_goal(worker.makeDrvOutputSubstitutionGoal(DrvOutput{outputHash, wantedOutput})));
105104
else {
106105
auto * cap = getDerivationCA(*drv);
107106
waitees.insert(upcast_goal(worker.makePathSubstitutionGoal(
@@ -171,8 +170,6 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation)
171170
auto outputHashes = staticOutputHashes(worker.evalStore, *drv);
172171
auto resolvedHashes = staticOutputHashes(worker.store, drvResolved);
173172

174-
StorePathSet outputPaths;
175-
176173
auto outputHash = get(outputHashes, wantedOutput);
177174
auto resolvedHash = get(resolvedHashes, wantedOutput);
178175
if ((!outputHash) || (!resolvedHash))
@@ -212,7 +209,6 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation)
212209
worker.store.signRealisation(newRealisation);
213210
worker.store.registerDrvOutput(newRealisation);
214211
}
215-
outputPaths.insert(realisation.outPath);
216212

217213
auto status = success.status;
218214
if (status == BuildResult::Success::AlreadyValid)

src/libstore/build/drv-output-substitution-goal.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
namespace nix {
1010

11-
DrvOutputSubstitutionGoal::DrvOutputSubstitutionGoal(
12-
const DrvOutput & id, Worker & worker, RepairFlag repair, std::optional<ContentAddress> ca)
11+
DrvOutputSubstitutionGoal::DrvOutputSubstitutionGoal(const DrvOutput & id, Worker & worker)
1312
: Goal(worker, init())
1413
, id(id)
1514
{

src/libstore/build/worker.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ Worker::makePathSubstitutionGoal(const StorePath & path, RepairFlag repair, std:
104104
return initGoalIfNeeded(substitutionGoals[path], path, *this, repair, ca);
105105
}
106106

107-
std::shared_ptr<DrvOutputSubstitutionGoal>
108-
Worker::makeDrvOutputSubstitutionGoal(const DrvOutput & id, RepairFlag repair, std::optional<ContentAddress> ca)
107+
std::shared_ptr<DrvOutputSubstitutionGoal> Worker::makeDrvOutputSubstitutionGoal(const DrvOutput & id)
109108
{
110-
return initGoalIfNeeded(drvOutputSubstitutionGoals[id], id, *this, repair, ca);
109+
return initGoalIfNeeded(drvOutputSubstitutionGoals[id], id, *this);
111110
}
112111

113112
GoalPtr Worker::makeGoal(const DerivedPath & req, BuildMode buildMode)

src/libstore/include/nix/store/build/drv-output-substitution-goal.hh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,7 @@ class DrvOutputSubstitutionGoal : public Goal
2929
DrvOutput id;
3030

3131
public:
32-
DrvOutputSubstitutionGoal(
33-
const DrvOutput & id,
34-
Worker & worker,
35-
RepairFlag repair = NoRepair,
36-
std::optional<ContentAddress> ca = std::nullopt);
37-
38-
typedef void (DrvOutputSubstitutionGoal::*GoalState)();
39-
GoalState state;
32+
DrvOutputSubstitutionGoal(const DrvOutput & id, Worker & worker);
4033

4134
Co init();
4235
Co realisationFetched(Goals waitees, std::shared_ptr<const Realisation> outputInfo, nix::ref<nix::Store> sub);

src/libstore/include/nix/store/build/worker.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ public:
240240
*/
241241
std::shared_ptr<PathSubstitutionGoal> makePathSubstitutionGoal(
242242
const StorePath & storePath, RepairFlag repair = NoRepair, std::optional<ContentAddress> ca = std::nullopt);
243-
std::shared_ptr<DrvOutputSubstitutionGoal> makeDrvOutputSubstitutionGoal(
244-
const DrvOutput & id, RepairFlag repair = NoRepair, std::optional<ContentAddress> ca = std::nullopt);
243+
std::shared_ptr<DrvOutputSubstitutionGoal> makeDrvOutputSubstitutionGoal(const DrvOutput & id);
245244

246245
/**
247246
* Make a goal corresponding to the `DerivedPath`.

0 commit comments

Comments
 (0)