diff --git a/lix/legacy/build-remote.cc b/lix/legacy/build-remote.cc index dbf255b6e..8bb294fb3 100644 --- a/lix/legacy/build-remote.cc +++ b/lix/legacy/build-remote.cc @@ -346,31 +346,12 @@ connected: } - auto outputHashes = aio.blockOn(staticOutputHashes(*store, drv)); - std::set missingRealisations; StorePathSet missingPaths; - if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations) && !drv.type().hasKnownOutputPaths()) { - for (auto & outputName : wantedOutputs) { - auto thisOutputHash = outputHashes.at(outputName); - auto thisOutputId = DrvOutput{ thisOutputHash, outputName }; - if (!aio.blockOn(store->queryRealisation(thisOutputId))) { - debug("missing output %s", outputName); - assert(optResult); - auto & result = *optResult; - auto i = result.builtOutputs.find(outputName); - assert(i != result.builtOutputs.end()); - auto & newRealisation = i->second; - missingRealisations.insert(newRealisation); - missingPaths.insert(newRealisation.outPath); - } - } - } else { - auto outputPaths = drv.outputsAndOptPaths(*store); - for (auto & [outputName, hopefullyOutputPath] : outputPaths) { - assert(hopefullyOutputPath.second); - if (!aio.blockOn(store->isValidPath(*hopefullyOutputPath.second))) - missingPaths.insert(*hopefullyOutputPath.second); - } + auto outputPaths = drv.outputsAndOptPaths(*store); + for (auto & [outputName, hopefullyOutputPath] : outputPaths) { + assert(hopefullyOutputPath.second); + if (!aio.blockOn(store->isValidPath(*hopefullyOutputPath.second))) + missingPaths.insert(*hopefullyOutputPath.second); } if (!missingPaths.empty()) { @@ -382,13 +363,6 @@ connected: copyPaths(*sshStore, *store, missingPaths, NoRepair, NoCheckSigs, NoSubstitute) ); } - // XXX: Should be done as part of `copyPaths` - for (auto & realisation : missingRealisations) { - // Should hold, because if the feature isn't enabled the set - // of missing realisations should be empty - experimentalFeatureSettings.require(Xp::CaDerivations); - aio.blockOn(store->registerDrvOutput(realisation)); - } return 0; } diff --git a/lix/libstore/build/derivation-goal.cc b/lix/libstore/build/derivation-goal.cc index 337dd9f4a..344a4fbc8 100644 --- a/lix/libstore/build/derivation-goal.cc +++ b/lix/libstore/build/derivation-goal.cc @@ -219,9 +219,6 @@ try { parsedDrv = std::make_unique(drvPath, *drv); - if (!drv->type().hasKnownOutputPaths()) - throw UnimplementedError("ca derivations are not supported"); - for (auto & i : drv->outputsAndOptPaths(worker.store)) if (i.second.second) TRY_AWAIT(worker.store.addTempRoot(*i.second.second)); @@ -1430,39 +1427,20 @@ void DerivationGoal::flushLine() kj::Promise>>> DerivationGoal::queryPartialDerivationOutputMap() try { - if (!useDerivation || drv->type().hasKnownOutputPaths()) { - std::map> res; - for (auto & [name, output] : drv->outputs) - res.insert_or_assign(name, output.path(worker.store, drv->name, name)); - co_return res; - } else { - for (auto * drvStore : {&worker.evalStore, &worker.store}) { - if (TRY_AWAIT(drvStore->isValidPath(drvPath))) { - co_return TRY_AWAIT(worker.store.queryPartialDerivationOutputMap(drvPath, drvStore) - ); - } - } - assert(false); - } + 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 { - if (!useDerivation || drv->type().hasKnownOutputPaths()) { - OutputPathMap res; - for (auto & [name, output] : drv->outputsAndOptPaths(worker.store)) - res.insert_or_assign(name, *output.second); - co_return res; - } else { - for (auto * drvStore : {&worker.evalStore, &worker.store}) { - if (TRY_AWAIT(drvStore->isValidPath(drvPath))) { - co_return TRY_AWAIT(worker.store.queryDerivationOutputMap(drvPath, drvStore)); - } - } - assert(false); - } + OutputPathMap res; + for (auto & [name, output] : drv->outputsAndOptPaths(worker.store)) + res.insert_or_assign(name, *output.second); + co_return res; } catch (...) { co_return result::current_exception(); } diff --git a/lix/libstore/derivations.cc b/lix/libstore/derivations.cc index e1c0d3c7e..f0c6e2188 100644 --- a/lix/libstore/derivations.cc +++ b/lix/libstore/derivations.cc @@ -65,19 +65,6 @@ bool DerivationType::isFixed() const }, raw); } -bool DerivationType::hasKnownOutputPaths() const -{ - return std::visit(overloaded { - [](const InputAddressed & ia) { - return true; - }, - [](const ContentAddressed & ca) { - return true; - }, - }, raw); -} - - bool DerivationType::isSandboxed() const { return std::visit(overloaded { diff --git a/lix/libstore/derivations.hh b/lix/libstore/derivations.hh index bd44e41b8..8b4ff6179 100644 --- a/lix/libstore/derivations.hh +++ b/lix/libstore/derivations.hh @@ -169,13 +169,6 @@ struct DerivationType { * controlled separately. Always true for non-CA derivations. */ bool isSandboxed() const; - - /** - * Does the derivation knows its own output paths? - * Only true when there's no floating-ca derivation involved in the - * closure, or if fixed output. - */ - bool hasKnownOutputPaths() const; }; struct BasicDerivation diff --git a/lix/libstore/parsed-derivations.cc b/lix/libstore/parsed-derivations.cc index b133a17c0..e86074450 100644 --- a/lix/libstore/parsed-derivations.cc +++ b/lix/libstore/parsed-derivations.cc @@ -96,8 +96,6 @@ StringSet ParsedDerivation::getRequiredSystemFeatures() const StringSet res; for (auto & i : getStringsAttr("requiredSystemFeatures").value_or(Strings())) res.insert(i); - if (!drv.type().hasKnownOutputPaths()) - res.insert("ca-derivations"); return res; } diff --git a/lix/libstore/store-api.cc b/lix/libstore/store-api.cc index 1a6a9f93e..02449e237 100644 --- a/lix/libstore/store-api.cc +++ b/lix/libstore/store-api.cc @@ -1447,18 +1447,6 @@ try { } } - if (!experimentalFeatureSettings.isEnabled(Xp::CaDerivations) || !TRY_AWAIT(isValidPath(path))) - co_return path; - - auto drv = TRY_AWAIT(readDerivation(path)); - if (!drv.type().hasKnownOutputPaths()) { - // The build log is actually attached to the corresponding - // resolved derivation, so we need to get it first - auto resolvedDrv = TRY_AWAIT(drv.tryResolve(*this)); - if (resolvedDrv) - co_return TRY_AWAIT(writeDerivation(*this, *resolvedDrv, NoRepair, true)); - } - co_return path; } catch (...) { co_return result::current_exception();