From f25dc923ca7de911e100340dbaea7667e5c0fefb Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 16 May 2025 13:16:18 +0200 Subject: [PATCH] libstore: remove ca support from common store api this removes the ca-derivations system feature and, perhaps most importantly, realisation closure copy support. the latter is not needed any more and its existence blocks some more code removal. Change-Id: I2931b03637e25d35252ae6bd5f34f0c0168d80e9 --- lix/libstore/store-api.cc | 51 +++------------------------------------ 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/lix/libstore/store-api.cc b/lix/libstore/store-api.cc index 02449e237..301ff74cd 100644 --- a/lix/libstore/store-api.cc +++ b/lix/libstore/store-api.cc @@ -485,12 +485,7 @@ try { StringSet StoreConfig::getDefaultSystemFeatures() { - auto res = settings.systemFeatures.get(); - - if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) - res.insert("ca-derivations"); - - return res; + return settings.systemFeatures.get(); } Store::Store(const StoreConfig & config) : state({(size_t) config.pathInfoCacheSize}) @@ -1171,53 +1166,13 @@ kj::Promise>> copyPaths( SubstituteFlag substitute) try { StorePathSet storePaths; - std::set toplevelRealisations; for (auto & path : paths) { storePaths.insert(path.path()); if (auto realisation = std::get_if(&path.raw)) { - experimentalFeatureSettings.require(Xp::CaDerivations); - toplevelRealisations.insert(*realisation); + throw UnimplementedError("ca derivations are not supported"); } } - auto pathsMap = - TRY_AWAIT(copyPaths(srcStore, dstStore, storePaths, repair, checkSigs, substitute)); - - try { - // Copy the realisation closure - TRY_AWAIT(processGraphAsync( - TRY_AWAIT(Realisation::closure(srcStore, toplevelRealisations)), - // NOLINTNEXTLINE(cppcoreguidelines-avoid-capturing-lambda-coroutines) - [&](const Realisation & current) -> kj::Promise>> { - try { - std::set children; - for (const auto & [drvOutput, _] : current.dependentRealisations) { - auto currentChild = TRY_AWAIT(srcStore.queryRealisation(drvOutput)); - if (!currentChild) - throw Error( - "incomplete realisation closure: '%s' is a " - "dependency of '%s' but isn't registered", - drvOutput.to_string(), current.id.to_string()); - children.insert(*currentChild); - } - co_return children; - } catch (...) { - co_return result::current_exception(); - } - }, - [&](const Realisation& current) -> kj::Promise> { - return dstStore.registerDrvOutput(current, checkSigs); - })); - } catch (MissingExperimentalFeature & e) { - // Don't fail if the remote doesn't support CA derivations is it might - // not be within our control to change that, and we might still want - // to at least copy the output paths. - if (e.missingFeature == Xp::CaDerivations) - ignoreExceptionExceptInterrupt(); - else - throw; - } - - co_return pathsMap; + co_return TRY_AWAIT(copyPaths(srcStore, dstStore, storePaths, repair, checkSigs, substitute)); } catch (...) { co_return result::current_exception(); }