diff options
author | regnat <rg@regnat.ovh> | 2021-05-19 16:27:09 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-06-23 11:27:16 +0200 |
commit | d32cf0c17a3e5e139c384375084d9eb6aa428c3b (patch) | |
tree | 413268d41ee42edc6303a9568da854b010ecec40 /src | |
parent | b8f7177a7b2e884cbfb8bbe3c1ee8d586159fbb3 (diff) |
Gracefully ignore a substituter if it holds an incompatible realisation
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/build/drv-output-substitution-goal.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc index 1703e845d..ec3a8d758 100644 --- a/src/libstore/build/drv-output-substitution-goal.cc +++ b/src/libstore/build/drv-output-substitution-goal.cc @@ -17,6 +17,13 @@ DrvOutputSubstitutionGoal::DrvOutputSubstitutionGoal(const DrvOutput& id, Worker void DrvOutputSubstitutionGoal::init() { trace("init"); + + /* If the derivation already exists, we’re done */ + if (worker.store.queryRealisation(id)) { + amDone(ecSuccess); + return; + } + subs = settings.useSubstitutes ? getDefaultSubstituters() : std::list<ref<Store>>(); tryNext(); } @@ -53,9 +60,18 @@ void DrvOutputSubstitutionGoal::tryNext() return; } - for (const auto & [drvOutputDep, _] : outputInfo->dependentRealisations) { - if (drvOutputDep != id) { - addWaitee(worker.makeDrvOutputSubstitutionGoal(drvOutputDep)); + for (const auto & [depId, depPath] : outputInfo->dependentRealisations) { + if (depId != id) { + if (auto localOutputInfo = worker.store.queryRealisation(depId); + localOutputInfo && localOutputInfo->outPath != depPath) { + warn( + "substituter '%s' has an incompatible realisation for '%s', ignoring", + sub->getUri(), + depId.to_string()); + tryNext(); + return; + } + addWaitee(worker.makeDrvOutputSubstitutionGoal(depId)); } } |