mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56: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. */
|
we care about all outputs. */
|
||||||
auto outputHashes = staticOutputHashes(worker.evalStore, *drv);
|
auto outputHashes = staticOutputHashes(worker.evalStore, *drv);
|
||||||
for (auto & [outputName, outputHash] : outputHashes) {
|
for (auto & [outputName, outputHash] : outputHashes) {
|
||||||
InitialOutput v{
|
InitialOutput v{.outputHash = outputHash};
|
||||||
.wanted = true, // Will be refined later
|
|
||||||
.outputHash = outputHash};
|
|
||||||
|
|
||||||
/* TODO we might want to also allow randomizing the paths
|
/* TODO we might want to also allow randomizing the paths
|
||||||
for regular CA derivations, e.g. for sake of checking
|
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())
|
// this is an invalid output, gets caught with (!wantedOutputsLeft.empty())
|
||||||
continue;
|
continue;
|
||||||
auto & info = *initialOutput;
|
auto & info = *initialOutput;
|
||||||
info.wanted = true;
|
|
||||||
if (i.second) {
|
if (i.second) {
|
||||||
auto outputPath = *i.second;
|
auto outputPath = *i.second;
|
||||||
info.known = {
|
info.known = {
|
||||||
|
|
@ -1237,8 +1234,6 @@ std::pair<bool, SingleDrvOutputs> DerivationBuildingGoal::checkPathValidity()
|
||||||
|
|
||||||
bool allValid = true;
|
bool allValid = true;
|
||||||
for (auto & [_, status] : initialOutputs) {
|
for (auto & [_, status] : initialOutputs) {
|
||||||
if (!status.wanted)
|
|
||||||
continue;
|
|
||||||
if (!status.known || !status.known->isValid()) {
|
if (!status.known || !status.known->isValid()) {
|
||||||
allValid = false;
|
allValid = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ struct InitialOutputStatus
|
||||||
|
|
||||||
struct InitialOutput
|
struct InitialOutput
|
||||||
{
|
{
|
||||||
bool wanted;
|
|
||||||
Hash outputHash;
|
Hash outputHash;
|
||||||
std::optional<InitialOutputStatus> known;
|
std::optional<InitialOutputStatus> known;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1481,8 +1481,8 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||||
auto & initialInfo = *initialOutput;
|
auto & initialInfo = *initialOutput;
|
||||||
|
|
||||||
/* Don't register if already valid, and not checking */
|
/* Don't register if already valid, and not checking */
|
||||||
initialInfo.wanted = buildMode == bmCheck || !(initialInfo.known && initialInfo.known->isValid());
|
bool wanted = buildMode == bmCheck || !(initialInfo.known && initialInfo.known->isValid());
|
||||||
if (!initialInfo.wanted) {
|
if (!wanted) {
|
||||||
outputReferencesIfUnregistered.insert_or_assign(
|
outputReferencesIfUnregistered.insert_or_assign(
|
||||||
outputName, AlreadyRegistered{.path = initialInfo.known->path});
|
outputName, AlreadyRegistered{.path = initialInfo.known->path});
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue