aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaeer Bar-Yam <taeer.bar-yam@tweag.io>2022-12-05 11:27:47 -0500
committerTaeer Bar-Yam <taeer.bar-yam@tweag.io>2022-12-05 11:27:47 -0500
commite4f9f3bf246d66c57b07b45583469b98ba0db367 (patch)
treefdbf309b1b7f523f6d33f88664b35e22072b5a01
parent14c3d7604805720e60c3aa83879d635685466760 (diff)
check the store for input before failing (hopefully fix #6700)
-rw-r--r--src/libstore/build/derivation-goal.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index 67cfc38af..5aed51bcd 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -501,6 +501,14 @@ void DerivationGoal::inputsRealised()
now-known results of dependencies. If so, we become a
stub goal aliasing that resolved derivation goal. */
std::optional attempt = fullDrv.tryResolve(worker.store, inputDrvOutputs);
+ if (!attempt) {
+ /* TODO (impure derivations-induced tech debt) (see below):
+ The above attempt should have found it, but because we manage
+ inputDrvOutputs statefully, sometimes it gets out of sync with
+ the real source of truth (store). So we query the store
+ directly if there's a problem. */
+ attempt = fullDrv.tryResolve(worker.store);
+ }
assert(attempt);
Derivation drvResolved { *std::move(attempt) };