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:
parent
316fef35dc
commit
14e355d87d
3 changed files with 3 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ struct InitialOutputStatus
|
|||
|
||||
struct InitialOutput
|
||||
{
|
||||
bool wanted;
|
||||
Hash outputHash;
|
||||
std::optional<InitialOutputStatus> known;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue