1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 09:49:36 +01:00

Revert "Merge pull request #14097 from obsidiansystems/light-realisation-improvements"

This reverts commit dc8c1461da, reversing
changes made to 28adcfda32.
This commit is contained in:
Sergei Zimmerman 2025-10-05 21:54:32 +03:00
parent 7ba3ef21a6
commit 7e39ab4dc7
No known key found for this signature in database
32 changed files with 254 additions and 423 deletions

View file

@ -1036,7 +1036,7 @@ bool LocalStore::pathInfoIsUntrusted(const ValidPathInfo & info)
bool LocalStore::realisationIsUntrusted(const Realisation & realisation)
{
return config->requireSigs && !realisation.checkSignatures(realisation.id, getPublicKeys());
return config->requireSigs && !realisation.checkSignatures(getPublicKeys());
}
void LocalStore::addToStore(const ValidPathInfo & info, Source & source, RepairFlag repair, CheckSigsFlag checkSigs)
@ -1586,7 +1586,7 @@ void LocalStore::addSignatures(const StorePath & storePath, const StringSet & si
});
}
std::optional<std::pair<int64_t, UnkeyedRealisation>>
std::optional<std::pair<int64_t, Realisation>>
LocalStore::queryRealisationCore_(LocalStore::State & state, const DrvOutput & id)
{
auto useQueryRealisedOutput(state.stmts->QueryRealisedOutput.use()(id.strHash())(id.outputName));
@ -1598,13 +1598,14 @@ LocalStore::queryRealisationCore_(LocalStore::State & state, const DrvOutput & i
return {
{realisationDbId,
UnkeyedRealisation{
Realisation{
.id = id,
.outPath = outputPath,
.signatures = signatures,
}}};
}
std::optional<const UnkeyedRealisation> LocalStore::queryRealisation_(LocalStore::State & state, const DrvOutput & id)
std::optional<const Realisation> LocalStore::queryRealisation_(LocalStore::State & state, const DrvOutput & id)
{
auto maybeCore = queryRealisationCore_(state, id);
if (!maybeCore)
@ -1630,13 +1631,13 @@ std::optional<const UnkeyedRealisation> LocalStore::queryRealisation_(LocalStore
}
void LocalStore::queryRealisationUncached(
const DrvOutput & id, Callback<std::shared_ptr<const UnkeyedRealisation>> callback) noexcept
const DrvOutput & id, Callback<std::shared_ptr<const Realisation>> callback) noexcept
{
try {
auto maybeRealisation = retrySQLite<std::optional<const UnkeyedRealisation>>(
[&]() { return queryRealisation_(*_state->lock(), id); });
auto maybeRealisation =
retrySQLite<std::optional<const Realisation>>([&]() { return queryRealisation_(*_state->lock(), id); });
if (maybeRealisation)
callback(std::make_shared<const UnkeyedRealisation>(maybeRealisation.value()));
callback(std::make_shared<const Realisation>(maybeRealisation.value()));
else
callback(nullptr);