1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

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.
This commit is contained in:
John Ericson 2025-08-14 10:26:23 -04:00
parent 316fef35dc
commit 14e355d87d
3 changed files with 3 additions and 9 deletions

View file

@ -157,9 +157,7 @@ Goal::Co DerivationBuildingGoal::gaveUpOnSubstitution()
we care about all outputs. */
auto outputHashes = staticOutputHashes(worker.evalStore, *drv);
for (auto & [outputName, outputHash] : outputHashes) {
InitialOutput v{
.wanted = true, // Will be refined later
.outputHash = outputHash};
InitialOutput v{.outputHash = outputHash};
/* TODO we might want to also allow randomizing the paths
for regular CA derivations, e.g. for sake of checking
@ -1202,7 +1200,6 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
continue;
auto & info = *initialOutput;
info.wanted = true;
if (i.second) {
auto outputPath = *i.second;
info.known = {
@ -1237,8 +1234,6 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
bool allValid = true;
for (auto & [_, status] : initialOutputs) {
if (!status.wanted)
continue;
if (!status.known || !status.known->isValid()) {
allValid = false;
break;

View file

@ -45,7 +45,6 @@ struct InitialOutputStatus
struct InitialOutput
{
bool wanted;
Hash outputHash;
std::optional<InitialOutputStatus> known;
};

View file

@ -1481,8 +1481,8 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
auto & initialInfo = *initialOutput;
/* Don't register if already valid, and not checking */
initialInfo.wanted = buildMode == bmCheck || !(initialInfo.known && initialInfo.known->isValid());
if (!initialInfo.wanted) {
bool wanted = buildMode == bmCheck || !(initialInfo.known && initialInfo.known->isValid());
if (!wanted) {
outputReferencesIfUnregistered.insert_or_assign(
outputName, AlreadyRegistered{.path = initialInfo.known->path});
continue;