1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 00:07:58 +02:00

Prevent the global registry from being GC'ed

Issue #2868.
This commit is contained in:
Eelco Dolstra 2019-05-22 23:43:58 +02:00
parent df3f5a78d5
commit f0d6d67af9
3 changed files with 5 additions and 0 deletions

View file

@ -913,6 +913,9 @@ CachedDownloadResult Downloader::downloadCached(
url, request.expectedHash.to_string(), gotHash.to_string());
}
if (request.gcRoot)
store->addIndirectRoot(fileLink);
result.storePath = storePath;
result.path = store->toRealPath(storePath);
return result;

View file

@ -48,6 +48,7 @@ struct CachedDownloadRequest
std::string name;
Hash expectedHash;
unsigned int ttl = settings.tarballTtl;
bool gcRoot = false;
CachedDownloadRequest(const std::string & uri)
: uri(uri) { }