Skip to content

Commit 14e355d

Browse files
committed
Remove InitialOutput::wanted
No derivation goal type has a notion of variable wanted outputs any more. They either want them all, or they just care about a single output, in which case we would just store this information for the one output in question.
1 parent 316fef3 commit 14e355d

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/libstore/build/derivation-building-goal.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution()
157157
we care about all outputs. */
158158
auto outputHashes = staticOutputHashes(worker.evalStore, *drv);
159159
for (auto & [outputName, outputHash] : outputHashes) {
160-
InitialOutput v{
161-
.wanted = true, // Will be refined later
162-
.outputHash = outputHash};
160+
InitialOutput v{.outputHash = outputHash};
163161

164162
/* TODO we might want to also allow randomizing the paths
165163
for regular CA derivations, e.g. for sake of checking
@@ -1202,7 +1200,6 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
12021200
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
12031201
continue;
12041202
auto & info = *initialOutput;
1205-
info.wanted = true;
12061203
if (i.second) {
12071204
auto outputPath = *i.second;
12081205
info.known = {
@@ -1237,8 +1234,6 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
12371234

12381235
bool allValid = true;
12391236
for (auto & [_, status] : initialOutputs) {
1240-
if (!status.wanted)
1241-
continue;
12421237
if (!status.known || !status.known->isValid()) {
12431238
allValid = false;
12441239
break;

src/libstore/include/nix/store/build/derivation-building-misc.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ struct InitialOutputStatus
4545

4646
struct InitialOutput
4747
{
48-
bool wanted;
4948
Hash outputHash;
5049
std::optional<InitialOutputStatus> known;
5150
};

src/libstore/unix/build/derivation-builder.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,8 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
14811481
auto & initialInfo = *initialOutput;
14821482

14831483
/* Don't register if already valid, and not checking */
1484-
initialInfo.wanted = buildMode == bmCheck || !(initialInfo.known && initialInfo.known->isValid());
1485-
if (!initialInfo.wanted) {
1484+
bool wanted = buildMode == bmCheck || !(initialInfo.known && initialInfo.known->isValid());
1485+
if (!wanted) {
14861486
outputReferencesIfUnregistered.insert_or_assign(
14871487
outputName, AlreadyRegistered{.path = initialInfo.known->path});
14881488
continue;

0 commit comments

Comments
 (0)