diff --git a/lix/libstore/binary-cache-store.cc b/lix/libstore/binary-cache-store.cc index d9487f5b0..470a24218 100644 --- a/lix/libstore/binary-cache-store.cc +++ b/lix/libstore/binary-cache-store.cc @@ -520,17 +520,6 @@ try { co_return result::current_exception(); } -kj::Promise> BinaryCacheStore::registerDrvOutput(const Realisation& info) -try { - if (diskCache) - diskCache->upsertRealisation(getUri(), info); - auto filePath = realisationsPrefix + "/" + info.id.to_string() + ".doi"; - upsertFile(filePath, info.toJSON().dump(), "application/json"); - co_return result::success(); -} catch (...) { - co_return result::current_exception(); -} - ref BinaryCacheStore::getFSAccessor() { return make_ref(ref(*this), config().localNarCache); diff --git a/lix/libstore/binary-cache-store.hh b/lix/libstore/binary-cache-store.hh index cea019891..68ca3f3e5 100644 --- a/lix/libstore/binary-cache-store.hh +++ b/lix/libstore/binary-cache-store.hh @@ -146,8 +146,6 @@ public: const StorePathSet & references, RepairFlag repair) override; - kj::Promise> registerDrvOutput(const Realisation & info) override; - kj::Promise>> queryRealisationUncached(const DrvOutput &) override; diff --git a/lix/libstore/daemon.cc b/lix/libstore/daemon.cc index 18f650770..f591b3a74 100644 --- a/lix/libstore/daemon.cc +++ b/lix/libstore/daemon.cc @@ -947,18 +947,7 @@ static void performOp(AsyncIoRoot & aio, TunnelLogger * logger, ref store } case WorkerProto::Op::RegisterDrvOutput: { - logger->startWork(); - if (GET_PROTOCOL_MINOR(clientVersion) < 31) { - auto outputId = DrvOutput::parse(readString(from)); - auto outputPath = StorePath(readString(from)); - aio.blockOn(store->registerDrvOutput(Realisation{ - .id = outputId, .outPath = outputPath})); - } else { - auto realisation = WorkerProto::Serialise::read(*store, rconn); - aio.blockOn(store->registerDrvOutput(realisation)); - } - logger->stopWork(); - break; + throw UnimplementedError("ca derivations are not supported"); } case WorkerProto::Op::QueryRealisation: { diff --git a/lix/libstore/local-store.cc b/lix/libstore/local-store.cc index 6426d9bf5..4fb7320f4 100644 --- a/lix/libstore/local-store.cc +++ b/lix/libstore/local-store.cc @@ -766,82 +766,6 @@ void canonicalisePathMetaData(const Path & path, } -kj::Promise> -LocalStore::registerDrvOutput(const Realisation & info, CheckSigsFlag checkSigs) -try { - experimentalFeatureSettings.require(Xp::CaDerivations); - if (checkSigs == NoCheckSigs || !realisationIsUntrusted(info)) - TRY_AWAIT(registerDrvOutput(info)); - else - throw Error("cannot register realisation '%s' because it lacks a signature by a trusted key", info.outPath.to_string()); - co_return result::success(); -} catch (...) { - co_return result::current_exception(); -} - -kj::Promise> LocalStore::registerDrvOutput(const Realisation & info) -try { - experimentalFeatureSettings.require(Xp::CaDerivations); - // NOLINTNEXTLINE(cppcoreguidelines-avoid-capturing-lambda-coroutines) - TRY_AWAIT(retrySQLite([&]() -> kj::Promise> { - try { - auto state = co_await _dbState.lock(); - if (auto oldR = queryRealisation_(*state, info.id)) { - if (info.isCompatibleWith(*oldR)) { - auto combinedSignatures = oldR->signatures; - combinedSignatures.insert(info.signatures.begin(), - info.signatures.end()); - state->stmts->UpdateRealisedOutput.use() - (concatStringsSep(" ", combinedSignatures)) - (info.id.strHash()) - (info.id.outputName) - .exec(); - } else { - throw Error("Trying to register a realisation of '%s', but we already " - "have another one locally.\n" - "Local: %s\n" - "Remote: %s", - info.id.to_string(), - printStorePath(oldR->outPath), - printStorePath(info.outPath) - ); - } - } else { - state->stmts->RegisterRealisedOutput.use() - (info.id.strHash()) - (info.id.outputName) - (printStorePath(info.outPath)) - (concatStringsSep(" ", info.signatures)) - .exec(); - } - for (auto & [outputId, depPath] : info.dependentRealisations) { - auto localRealisation = queryRealisationCore_(*state, outputId); - if (!localRealisation) - throw Error("unable to register the derivation '%s' as it " - "depends on the non existent '%s'", - info.id.to_string(), outputId.to_string()); - if (localRealisation->second.outPath != depPath) - throw Error("unable to register the derivation '%s' as it " - "depends on a realisation of '%s' that doesn’t" - "match what we have locally", - info.id.to_string(), outputId.to_string()); - state->stmts->AddRealisationReference.use() - (info.id.strHash()) - (info.id.outputName) - (outputId.strHash()) - (outputId.outputName) - .exec(); - } - co_return result::success(); - } catch (...) { - co_return result::current_exception(); - } - })); - co_return result::success(); -} catch (...) { - co_return result::current_exception(); -} - void LocalStore::cacheDrvOutputMapping( DBState & state, const uint64_t deriver, diff --git a/lix/libstore/local-store.hh b/lix/libstore/local-store.hh index c99c5c36d..b26f6ad49 100644 --- a/lix/libstore/local-store.hh +++ b/lix/libstore/local-store.hh @@ -319,9 +319,6 @@ public: * Register the store path 'output' as the output named 'outputName' of * derivation 'deriver'. */ - kj::Promise> registerDrvOutput(const Realisation & info) override; - kj::Promise> - registerDrvOutput(const Realisation & info, CheckSigsFlag checkSigs) override; void cacheDrvOutputMapping( DBState & state, const uint64_t deriver, diff --git a/lix/libstore/remote-store.cc b/lix/libstore/remote-store.cc index ec632c512..01b1bad5a 100644 --- a/lix/libstore/remote-store.cc +++ b/lix/libstore/remote-store.cc @@ -603,23 +603,6 @@ try { co_return result::current_exception(); } -kj::Promise> RemoteStore::registerDrvOutput(const Realisation & info) -try { - auto conn(TRY_AWAIT(getConnection())); - conn->to << WorkerProto::Op::RegisterDrvOutput; - if (GET_PROTOCOL_MINOR(conn->daemonVersion) < 31) { - REMOVE_AFTER_DROPPING_PROTO_MINOR(30); - conn->to << info.id.to_string(); - conn->to << std::string(info.outPath.to_string()); - } else { - conn->to << WorkerProto::write(*this, *conn, info); - } - conn.processStderr(); - co_return result::success(); -} catch (...) { - co_return result::current_exception(); -} - kj::Promise>> RemoteStore::queryRealisationUncached(const DrvOutput & id) try { diff --git a/lix/libstore/remote-store.hh b/lix/libstore/remote-store.hh index cdf974721..aaaaf3555 100644 --- a/lix/libstore/remote-store.hh +++ b/lix/libstore/remote-store.hh @@ -117,8 +117,6 @@ public: const StorePathSet & references, RepairFlag repair) override; - kj::Promise> registerDrvOutput(const Realisation & info) override; - kj::Promise>> queryRealisationUncached(const DrvOutput &) override; diff --git a/lix/libstore/store-api.hh b/lix/libstore/store-api.hh index 07e7353c8..ccb30a531 100644 --- a/lix/libstore/store-api.hh +++ b/lix/libstore/store-api.hh @@ -592,23 +592,6 @@ public: const StorePathSet & references, RepairFlag repair = NoRepair) = 0; - /** - * Add a mapping indicating that `deriver!outputName` maps to the output path - * `output`. - * - * This is redundant for known-input-addressed and fixed-output derivations - * as this information is already present in the drv file, but necessary for - * floating-ca derivations and their dependencies as there's no way to - * retrieve this information otherwise. - */ - virtual kj::Promise> registerDrvOutput(const Realisation & output) - try { unsupported("registerDrvOutput"); } catch (...) { return {result::current_exception()}; } - virtual kj::Promise> - registerDrvOutput(const Realisation & output, CheckSigsFlag checkSigs) - { - return registerDrvOutput(output); - } - /** * Generate a NAR dump of a store path. */