Only return wanted outputs

This commit is contained in:
Eelco Dolstra 2022-03-24 23:24:48 +01:00
parent 09796c0263
commit fe5509df9a
2 changed files with 3 additions and 5 deletions

View file

@ -311,14 +311,11 @@ void DerivationGoal::outputsSubstitutionTried()
gaveUpOnSubstitution();
}
/* At least one of the output paths could not be
produced using a substitute. So we have to build instead. */
void DerivationGoal::gaveUpOnSubstitution()
{
/* Make sure checkPathValidity() from now on checks all
outputs. */
wantedOutputs.clear();
/* The inputs must be built before we can build this goal. */
if (useDerivation)
for (auto & i : dynamic_cast<Derivation *>(drv.get())->inputDrvs)

View file

@ -2613,7 +2613,8 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
signRealisation(thisRealisation);
worker.store.registerDrvOutput(thisRealisation);
}
builtOutputs.emplace(thisRealisation.id, thisRealisation);
if (wantedOutputs.empty() || wantedOutputs.count(outputName))
builtOutputs.emplace(thisRealisation.id, thisRealisation);
}
return builtOutputs;