aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/daemon.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-30 00:39:06 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-09-30 00:39:06 +0000
commit45a0ed82f089158a79c8c25ef844c55e4a74fc35 (patch)
treeddc7d1644214b7cc8ca448c99e4395af179c7b29 /src/libstore/daemon.cc
parente9fc2031f0c89fe65609ce6a8211186d164152fb (diff)
Revert "Use template structs instead of phantoms"
This reverts commit 9ab07e99f527d1fa3adfa02839da477a1528d64b.
Diffstat (limited to 'src/libstore/daemon.cc')
-rw-r--r--src/libstore/daemon.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc
index 98fd2048d..72203d1b2 100644
--- a/src/libstore/daemon.cc
+++ b/src/libstore/daemon.cc
@@ -247,7 +247,7 @@ static void writeValidPathInfo(
{
to << (info->deriver ? store->printStorePath(*info->deriver) : "")
<< info->narHash.to_string(Base16, false);
- WorkerProto<StorePathSet>::write(*store, to, info->references);
+ nix::worker_proto::write(*store, to, info->references);
to << info->registrationTime << info->narSize;
if (GET_PROTOCOL_MINOR(clientVersion) >= 16) {
to << info->ultimate
@@ -272,11 +272,11 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
}
case wopQueryValidPaths: {
- auto paths = WorkerProto<StorePathSet>::read(*store, from);
+ auto paths = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
logger->startWork();
auto res = store->queryValidPaths(paths);
logger->stopWork();
- WorkerProto<StorePathSet>::write(*store, to, res);
+ nix::worker_proto::write(*store, to, res);
break;
}
@@ -292,11 +292,11 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
}
case wopQuerySubstitutablePaths: {
- auto paths = WorkerProto<StorePathSet>::read(*store, from);
+ auto paths = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
logger->startWork();
auto res = store->querySubstitutablePaths(paths);
logger->stopWork();
- WorkerProto<StorePathSet>::write(*store, to, res);
+ nix::worker_proto::write(*store, to, res);
break;
}
@@ -325,7 +325,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
paths = store->queryValidDerivers(path);
else paths = store->queryDerivationOutputs(path);
logger->stopWork();
- WorkerProto<StorePathSet>::write(*store, to, paths);
+ nix::worker_proto::write(*store, to, paths);
break;
}
@@ -343,7 +343,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
logger->startWork();
auto outputs = store->queryPartialDerivationOutputMap(path);
logger->stopWork();
- WorkerProto<std::map<std::string, std::optional<StorePath>>>::write(*store, to, outputs);
+ nix::worker_proto::write(*store, to, outputs);
break;
}
@@ -369,7 +369,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
if (GET_PROTOCOL_MINOR(clientVersion) >= 25) {
auto name = readString(from);
auto camStr = readString(from);
- auto refs = WorkerProto<StorePathSet>::read(*store, from);
+ auto refs = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
bool repairBool;
from >> repairBool;
auto repair = RepairFlag{repairBool};
@@ -449,7 +449,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
case wopAddTextToStore: {
string suffix = readString(from);
string s = readString(from);
- auto refs = WorkerProto<StorePathSet>::read(*store, from);
+ auto refs = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
logger->startWork();
auto path = store->addTextToStore(suffix, s, refs, NoRepair);
logger->stopWork();
@@ -608,7 +608,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
case wopCollectGarbage: {
GCOptions options;
options.action = (GCOptions::GCAction) readInt(from);
- options.pathsToDelete = WorkerProto<StorePathSet>::read(*store, from);
+ options.pathsToDelete = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
from >> options.ignoreLiveness >> options.maxFreed;
// obsolete fields
readInt(from);
@@ -677,7 +677,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
else {
to << 1
<< (i->second.deriver ? store->printStorePath(*i->second.deriver) : "");
- WorkerProto<StorePathSet>::write(*store, to, i->second.references);
+ nix::worker_proto::write(*store, to, i->second.references);
to << i->second.downloadSize
<< i->second.narSize;
}
@@ -688,11 +688,11 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
SubstitutablePathInfos infos;
StorePathCAMap pathsMap = {};
if (GET_PROTOCOL_MINOR(clientVersion) < 22) {
- auto paths = WorkerProto<StorePathSet>::read(*store, from);
+ auto paths = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
for (auto & path : paths)
pathsMap.emplace(path, std::nullopt);
} else
- pathsMap = WorkerProto<StorePathCAMap>::read(*store, from);
+ pathsMap = nix::worker_proto::read(*store, from, Phantom<StorePathCAMap> {});
logger->startWork();
store->querySubstitutablePathInfos(pathsMap, infos);
logger->stopWork();
@@ -700,7 +700,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
for (auto & i : infos) {
to << store->printStorePath(i.first)
<< (i.second.deriver ? store->printStorePath(*i.second.deriver) : "");
- WorkerProto<StorePathSet>::write(*store, to, i.second.references);
+ nix::worker_proto::write(*store, to, i.second.references);
to << i.second.downloadSize << i.second.narSize;
}
break;
@@ -710,7 +710,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
logger->startWork();
auto paths = store->queryAllValidPaths();
logger->stopWork();
- WorkerProto<StorePathSet>::write(*store, to, paths);
+ nix::worker_proto::write(*store, to, paths);
break;
}
@@ -782,7 +782,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
ValidPathInfo info { path, narHash };
if (deriver != "")
info.deriver = store->parseStorePath(deriver);
- info.references = WorkerProto<StorePathSet>::read(*store, from);
+ info.references = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
from >> info.registrationTime >> info.narSize >> info.ultimate;
info.sigs = readStrings<StringSet>(from);
info.ca = parseContentAddressOpt(readString(from));
@@ -835,9 +835,9 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
uint64_t downloadSize, narSize;
store->queryMissing(targets, willBuild, willSubstitute, unknown, downloadSize, narSize);
logger->stopWork();
- WorkerProto<StorePathSet>::write(*store, to, willBuild);
- WorkerProto<StorePathSet>::write(*store, to, willSubstitute);
- WorkerProto<StorePathSet>::write(*store, to, unknown);
+ nix::worker_proto::write(*store, to, willBuild);
+ nix::worker_proto::write(*store, to, willSubstitute);
+ nix::worker_proto::write(*store, to, unknown);
to << downloadSize << narSize;
break;
}