From b20cebf993780266513adcb176bef8edc8d30d1c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 14 Oct 2025 14:37:52 -0400 Subject: [PATCH 1/3] Remove unused typedef and field --- .../include/nix/store/build/drv-output-substitution-goal.hh | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh b/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh index b42336427..3128a719e 100644 --- a/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh +++ b/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh @@ -35,8 +35,6 @@ public: RepairFlag repair = NoRepair, std::optional ca = std::nullopt); - typedef void (DrvOutputSubstitutionGoal::*GoalState)(); - GoalState state; Co init(); Co realisationFetched(Goals waitees, std::shared_ptr outputInfo, nix::ref sub); From 46357468a4681cb722ddf03a550ff08ce7a1e36d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 14 Oct 2025 18:53:03 -0400 Subject: [PATCH 2/3] Remove unused parameters to `DrvOutputSubstitutionGoal` --- src/libstore/build/derivation-goal.cc | 3 +-- src/libstore/build/drv-output-substitution-goal.cc | 3 +-- src/libstore/build/worker.cc | 5 ++--- .../nix/store/build/drv-output-substitution-goal.hh | 7 +------ src/libstore/include/nix/store/build/worker.hh | 3 +-- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index b0081f709..dca058fb8 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -100,8 +100,7 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation) them. */ if (settings.useSubstitutes && drvOptions.substitutesAllowed()) { if (!checkResult) - waitees.insert(upcast_goal(worker.makeDrvOutputSubstitutionGoal( - DrvOutput{outputHash, wantedOutput}, buildMode == bmRepair ? Repair : NoRepair))); + waitees.insert(upcast_goal(worker.makeDrvOutputSubstitutionGoal(DrvOutput{outputHash, wantedOutput}))); else { auto * cap = getDerivationCA(*drv); waitees.insert(upcast_goal(worker.makePathSubstitutionGoal( diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc index 209d6d542..6635e214d 100644 --- a/src/libstore/build/drv-output-substitution-goal.cc +++ b/src/libstore/build/drv-output-substitution-goal.cc @@ -8,8 +8,7 @@ namespace nix { -DrvOutputSubstitutionGoal::DrvOutputSubstitutionGoal( - const DrvOutput & id, Worker & worker, RepairFlag repair, std::optional ca) +DrvOutputSubstitutionGoal::DrvOutputSubstitutionGoal(const DrvOutput & id, Worker & worker) : Goal(worker, init()) , id(id) { diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc index d23c53e77..3663a2c91 100644 --- a/src/libstore/build/worker.cc +++ b/src/libstore/build/worker.cc @@ -104,10 +104,9 @@ Worker::makePathSubstitutionGoal(const StorePath & path, RepairFlag repair, std: return initGoalIfNeeded(substitutionGoals[path], path, *this, repair, ca); } -std::shared_ptr -Worker::makeDrvOutputSubstitutionGoal(const DrvOutput & id, RepairFlag repair, std::optional ca) +std::shared_ptr Worker::makeDrvOutputSubstitutionGoal(const DrvOutput & id) { - return initGoalIfNeeded(drvOutputSubstitutionGoals[id], id, *this, repair, ca); + return initGoalIfNeeded(drvOutputSubstitutionGoals[id], id, *this); } GoalPtr Worker::makeGoal(const DerivedPath & req, BuildMode buildMode) diff --git a/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh b/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh index 3128a719e..c3ee9019f 100644 --- a/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh +++ b/src/libstore/include/nix/store/build/drv-output-substitution-goal.hh @@ -29,12 +29,7 @@ class DrvOutputSubstitutionGoal : public Goal DrvOutput id; public: - DrvOutputSubstitutionGoal( - const DrvOutput & id, - Worker & worker, - RepairFlag repair = NoRepair, - std::optional ca = std::nullopt); - + DrvOutputSubstitutionGoal(const DrvOutput & id, Worker & worker); Co init(); Co realisationFetched(Goals waitees, std::shared_ptr outputInfo, nix::ref sub); diff --git a/src/libstore/include/nix/store/build/worker.hh b/src/libstore/include/nix/store/build/worker.hh index bb0202dfd..173f7b222 100644 --- a/src/libstore/include/nix/store/build/worker.hh +++ b/src/libstore/include/nix/store/build/worker.hh @@ -240,8 +240,7 @@ public: */ std::shared_ptr makePathSubstitutionGoal( const StorePath & storePath, RepairFlag repair = NoRepair, std::optional ca = std::nullopt); - std::shared_ptr makeDrvOutputSubstitutionGoal( - const DrvOutput & id, RepairFlag repair = NoRepair, std::optional ca = std::nullopt); + std::shared_ptr makeDrvOutputSubstitutionGoal(const DrvOutput & id); /** * Make a goal corresponding to the `DerivedPath`. From 632ccfb8c0eac7deb42a0153d28847fe8eb7c0dd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 15 Oct 2025 11:03:50 -0400 Subject: [PATCH 3/3] Remove dead `outputPaths` variable. --- src/libstore/build/derivation-goal.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index dca058fb8..c50054caf 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -170,8 +170,6 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation) auto outputHashes = staticOutputHashes(worker.evalStore, *drv); auto resolvedHashes = staticOutputHashes(worker.store, drvResolved); - StorePathSet outputPaths; - auto outputHash = get(outputHashes, wantedOutput); auto resolvedHash = get(resolvedHashes, wantedOutput); if ((!outputHash) || (!resolvedHash)) @@ -211,7 +209,6 @@ Goal::Co DerivationGoal::haveDerivation(bool storeDerivation) worker.store.signRealisation(newRealisation); worker.store.registerDrvOutput(newRealisation); } - outputPaths.insert(realisation.outPath); auto status = success.status; if (status == BuildResult::Success::AlreadyValid)