1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +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

@ -502,15 +502,10 @@ StorePath BinaryCacheStore::addToStore(
->path;
}
std::string BinaryCacheStore::makeRealisationPath(const DrvOutput & id)
{
return realisationsPrefix + "/" + id.to_string() + ".doi";
}
void BinaryCacheStore::queryRealisationUncached(
const DrvOutput & id, Callback<std::shared_ptr<const UnkeyedRealisation>> callback) noexcept
const DrvOutput & id, Callback<std::shared_ptr<const Realisation>> callback) noexcept
{
auto outputInfoFilePath = makeRealisationPath(id);
auto outputInfoFilePath = realisationsPrefix + "/" + id.to_string() + ".doi";
auto callbackPtr = std::make_shared<decltype(callback)>(std::move(callback));
@ -520,12 +515,11 @@ void BinaryCacheStore::queryRealisationUncached(
if (!data)
return (*callbackPtr)({});
std::shared_ptr<const UnkeyedRealisation> realisation;
std::shared_ptr<const Realisation> realisation;
try {
realisation = std::make_shared<const UnkeyedRealisation>(nlohmann::json::parse(*data));
realisation = std::make_shared<const Realisation>(nlohmann::json::parse(*data));
} catch (Error & e) {
e.addTrace(
{}, "while parsing file '%s' as a realisation for key '%s'", outputInfoFilePath, id.to_string());
e.addTrace({}, "while parsing file '%s' as a realisation", outputInfoFilePath);
throw;
}
return (*callbackPtr)(std::move(realisation));
@ -541,7 +535,8 @@ void BinaryCacheStore::registerDrvOutput(const Realisation & info)
{
if (diskCache)
diskCache->upsertRealisation(config.getReference().render(/*FIXME withParams=*/false), info);
upsertFile(makeRealisationPath(info.id), static_cast<nlohmann::json>(info).dump(), "application/json");
auto filePath = realisationsPrefix + "/" + info.id.to_string() + ".doi";
upsertFile(filePath, static_cast<nlohmann::json>(info).dump(), "application/json");
}
ref<RemoteFSAccessor> BinaryCacheStore::getRemoteFSAccessor(bool requireValidPath)