From ab36085b6bfc0fd8f8a00cd7f61d262768746d9b Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 16 May 2025 13:16:18 +0200 Subject: [PATCH] libstore: remove DerivationGoal::queryPartialDerivationOutputMap it's fully redundant with queryDerivationOutputMap. Change-Id: I38475ab1249bdf9db66d8538fb230579f036a3f2 --- lix/libstore/build/derivation-goal.cc | 32 +++++++++------------------ lix/libstore/build/derivation-goal.hh | 3 +-- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/lix/libstore/build/derivation-goal.cc b/lix/libstore/build/derivation-goal.cc index 4ed42e225..9e6bc03c2 100644 --- a/lix/libstore/build/derivation-goal.cc +++ b/lix/libstore/build/derivation-goal.cc @@ -1416,16 +1416,6 @@ void DerivationGoal::flushLine() } -kj::Promise>>> DerivationGoal::queryPartialDerivationOutputMap() -try { - std::map> res; - for (auto & [name, output] : drv->outputs) - res.insert_or_assign(name, output.path(worker.store, drv->name, name)); - co_return res; -} catch (...) { - co_return result::current_exception(); -} - kj::Promise> DerivationGoal::queryDerivationOutputMap() try { OutputPathMap res; @@ -1450,7 +1440,7 @@ try { }, wantedOutputs.raw); SingleDrvOutputs validOutputs; - for (auto & i : TRY_AWAIT(queryPartialDerivationOutputMap())) { + for (auto & i : TRY_AWAIT(queryDerivationOutputMap())) { auto initialOutput = get(initialOutputs, i.first); if (!initialOutput) // this is an invalid output, gets catched with (!wantedOutputsLeft.empty()) @@ -1459,17 +1449,15 @@ try { info.wanted = wantedOutputs.contains(i.first); if (info.wanted) wantedOutputsLeft.erase(i.first); - if (i.second) { - auto outputPath = *i.second; - info.known = { - .path = outputPath, - .status = !TRY_AWAIT(worker.store.isValidPath(outputPath)) - ? PathStatus::Absent - : !checkHash || TRY_AWAIT(worker.pathContentsGood(outputPath)) - ? PathStatus::Valid - : PathStatus::Corrupt, - }; - } + auto & outputPath = i.second; + info.known = { + .path = outputPath, + .status = !TRY_AWAIT(worker.store.isValidPath(outputPath)) + ? PathStatus::Absent + : !checkHash || TRY_AWAIT(worker.pathContentsGood(outputPath)) + ? PathStatus::Valid + : PathStatus::Corrupt, + }; auto drvOutput = DrvOutput{info.outputHash, i.first}; if (info.known && info.known->isValid()) validOutputs.emplace(i.first, Realisation { drvOutput, info.known->path }); diff --git a/lix/libstore/build/derivation-goal.hh b/lix/libstore/build/derivation-goal.hh index 0ca01c070..3fee2bf5b 100644 --- a/lix/libstore/build/derivation-goal.hh +++ b/lix/libstore/build/derivation-goal.hh @@ -326,11 +326,10 @@ protected: public: /** - * Wrappers around the corresponding Store methods that first consult the + * Wrappers around the corresponding Store method that first consults the * derivation. This is currently needed because when there is no drv file * there also is no DB entry. */ - kj::Promise>>> queryPartialDerivationOutputMap(); kj::Promise> queryDerivationOutputMap(); /**