1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

importPaths(): Optionally add NARs to binary cache accessor

This enables an optimisation in hydra-queue-runner, preventing a
download of a NAR it just uploaded to the cache when reading files
like hydra-build-products.
This commit is contained in:
Eelco Dolstra 2016-02-26 15:20:10 +01:00
parent 1042c10fd0
commit bcc9943cee
10 changed files with 58 additions and 44 deletions

View file

@ -310,7 +310,7 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
case wopImportPaths: {
startWork();
TunnelSource source(from);
Paths paths = store->importPaths(!trusted, source);
Paths paths = store->importPaths(!trusted, source, 0);
stopWork();
to << paths;
break;
@ -322,8 +322,8 @@ static void performOp(ref<LocalStore> store, bool trusted, unsigned int clientVe
if (GET_PROTOCOL_MINOR(clientVersion) >= 15) {
mode = (BuildMode)readInt(from);
/* Repairing is not atomic, so disallowed for "untrusted"
clients. */
/* Repairing is not atomic, so disallowed for "untrusted"
clients. */
if (mode == bmRepair && !trusted)
throw Error("repairing is not supported when building through the Nix daemon");
}