forked from lix-project/lix
nix::worker_proto -> worker_proto
This commit is contained in:
parent
45a0ed82f0
commit
b759701652
8 changed files with 44 additions and 44 deletions
|
@ -1976,7 +1976,7 @@ HookReply DerivationGoal::tryBuildHook()
|
|||
|
||||
/* Tell the hook all the inputs that have to be copied to the
|
||||
remote system. */
|
||||
nix::worker_proto::write(worker.store, hook->sink, inputPaths);
|
||||
worker_proto::write(worker.store, hook->sink, inputPaths);
|
||||
|
||||
/* Tell the hooks the missing outputs that have to be copied back
|
||||
from the remote system. */
|
||||
|
@ -1987,7 +1987,7 @@ HookReply DerivationGoal::tryBuildHook()
|
|||
if (buildMode != bmCheck && status.known->isValid()) continue;
|
||||
missingPaths.insert(status.known->path);
|
||||
}
|
||||
nix::worker_proto::write(worker.store, hook->sink, missingPaths);
|
||||
worker_proto::write(worker.store, hook->sink, missingPaths);
|
||||
}
|
||||
|
||||
hook->sink = FdSink();
|
||||
|
|
|
@ -247,7 +247,7 @@ static void writeValidPathInfo(
|
|||
{
|
||||
to << (info->deriver ? store->printStorePath(*info->deriver) : "")
|
||||
<< info->narHash.to_string(Base16, false);
|
||||
nix::worker_proto::write(*store, to, info->references);
|
||||
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 = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
auto paths = worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
logger->startWork();
|
||||
auto res = store->queryValidPaths(paths);
|
||||
logger->stopWork();
|
||||
nix::worker_proto::write(*store, to, res);
|
||||
worker_proto::write(*store, to, res);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -292,11 +292,11 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
|||
}
|
||||
|
||||
case wopQuerySubstitutablePaths: {
|
||||
auto paths = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
auto paths = worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
logger->startWork();
|
||||
auto res = store->querySubstitutablePaths(paths);
|
||||
logger->stopWork();
|
||||
nix::worker_proto::write(*store, to, res);
|
||||
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();
|
||||
nix::worker_proto::write(*store, to, paths);
|
||||
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();
|
||||
nix::worker_proto::write(*store, to, outputs);
|
||||
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 = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
auto refs = 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 = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
auto refs = 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 = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
options.pathsToDelete = 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) : "");
|
||||
nix::worker_proto::write(*store, to, i->second.references);
|
||||
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 = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
auto paths = worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
for (auto & path : paths)
|
||||
pathsMap.emplace(path, std::nullopt);
|
||||
} else
|
||||
pathsMap = nix::worker_proto::read(*store, from, Phantom<StorePathCAMap> {});
|
||||
pathsMap = 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) : "");
|
||||
nix::worker_proto::write(*store, to, i.second.references);
|
||||
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();
|
||||
nix::worker_proto::write(*store, to, paths);
|
||||
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 = nix::worker_proto::read(*store, from, Phantom<StorePathSet> {});
|
||||
info.references = 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();
|
||||
nix::worker_proto::write(*store, to, willBuild);
|
||||
nix::worker_proto::write(*store, to, willSubstitute);
|
||||
nix::worker_proto::write(*store, to, unknown);
|
||||
worker_proto::write(*store, to, willBuild);
|
||||
worker_proto::write(*store, to, willSubstitute);
|
||||
worker_proto::write(*store, to, unknown);
|
||||
to << downloadSize << narSize;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -584,7 +584,7 @@ Source & readDerivation(Source & in, const Store & store, BasicDerivation & drv,
|
|||
drv.outputs.emplace(std::move(name), std::move(output));
|
||||
}
|
||||
|
||||
drv.inputSrcs = nix::worker_proto::read(store, in, Phantom<StorePathSet> {});
|
||||
drv.inputSrcs = worker_proto::read(store, in, Phantom<StorePathSet> {});
|
||||
in >> drv.platform >> drv.builder;
|
||||
drv.args = readStrings<Strings>(in);
|
||||
|
||||
|
@ -622,7 +622,7 @@ void writeDerivation(Sink & out, const Store & store, const BasicDerivation & dr
|
|||
},
|
||||
}, i.second.output);
|
||||
}
|
||||
nix::worker_proto::write(store, out, drv.inputSrcs);
|
||||
worker_proto::write(store, out, drv.inputSrcs);
|
||||
out << drv.platform << drv.builder << drv.args;
|
||||
out << drv.env.size();
|
||||
for (auto & i : drv.env)
|
||||
|
|
|
@ -45,7 +45,7 @@ void Store::exportPath(const StorePath & path, Sink & sink)
|
|||
teeSink
|
||||
<< exportMagic
|
||||
<< printStorePath(path);
|
||||
nix::worker_proto::write(*this, teeSink, info->references);
|
||||
worker_proto::write(*this, teeSink, info->references);
|
||||
teeSink
|
||||
<< (info->deriver ? printStorePath(*info->deriver) : "")
|
||||
<< 0;
|
||||
|
@ -73,7 +73,7 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs)
|
|||
|
||||
//Activity act(*logger, lvlInfo, format("importing path '%s'") % info.path);
|
||||
|
||||
auto references = nix::worker_proto::read(*this, source, Phantom<StorePathSet> {});
|
||||
auto references = worker_proto::read(*this, source, Phantom<StorePathSet> {});
|
||||
auto deriver = readString(source);
|
||||
auto narHash = hashString(htSHA256, *saved.s);
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ struct LegacySSHStore : public Store, public virtual LegacySSHStoreConfig
|
|||
auto deriver = readString(conn->from);
|
||||
if (deriver != "")
|
||||
info->deriver = parseStorePath(deriver);
|
||||
info->references = nix::worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
info->references = worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
readLongLong(conn->from); // download size
|
||||
info->narSize = readLongLong(conn->from);
|
||||
|
||||
|
@ -156,7 +156,7 @@ struct LegacySSHStore : public Store, public virtual LegacySSHStoreConfig
|
|||
<< printStorePath(info.path)
|
||||
<< (info.deriver ? printStorePath(*info.deriver) : "")
|
||||
<< info.narHash.to_string(Base16, false);
|
||||
nix::worker_proto::write(*this, conn->to, info.references);
|
||||
worker_proto::write(*this, conn->to, info.references);
|
||||
conn->to
|
||||
<< info.registrationTime
|
||||
<< info.narSize
|
||||
|
@ -185,7 +185,7 @@ struct LegacySSHStore : public Store, public virtual LegacySSHStoreConfig
|
|||
conn->to
|
||||
<< exportMagic
|
||||
<< printStorePath(info.path);
|
||||
nix::worker_proto::write(*this, conn->to, info.references);
|
||||
worker_proto::write(*this, conn->to, info.references);
|
||||
conn->to
|
||||
<< (info.deriver ? printStorePath(*info.deriver) : "")
|
||||
<< 0
|
||||
|
@ -301,10 +301,10 @@ public:
|
|||
conn->to
|
||||
<< cmdQueryClosure
|
||||
<< includeOutputs;
|
||||
nix::worker_proto::write(*this, conn->to, paths);
|
||||
worker_proto::write(*this, conn->to, paths);
|
||||
conn->to.flush();
|
||||
|
||||
for (auto & i : nix::worker_proto::read(*this, conn->from, Phantom<StorePathSet> {}))
|
||||
for (auto & i : worker_proto::read(*this, conn->from, Phantom<StorePathSet> {}))
|
||||
out.insert(i);
|
||||
}
|
||||
|
||||
|
@ -317,10 +317,10 @@ public:
|
|||
<< cmdQueryValidPaths
|
||||
<< false // lock
|
||||
<< maybeSubstitute;
|
||||
nix::worker_proto::write(*this, conn->to, paths);
|
||||
worker_proto::write(*this, conn->to, paths);
|
||||
conn->to.flush();
|
||||
|
||||
return nix::worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
return worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
}
|
||||
|
||||
void connect() override
|
||||
|
|
|
@ -329,7 +329,7 @@ StorePathSet RemoteStore::queryValidPaths(const StorePathSet & paths, Substitute
|
|||
return res;
|
||||
} else {
|
||||
conn->to << wopQueryValidPaths;
|
||||
nix::worker_proto::write(*this, conn->to, paths);
|
||||
worker_proto::write(*this, conn->to, paths);
|
||||
conn.processStderr();
|
||||
return worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ StorePathSet RemoteStore::queryAllValidPaths()
|
|||
auto conn(getConnection());
|
||||
conn->to << wopQueryAllValidPaths;
|
||||
conn.processStderr();
|
||||
return nix::worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
return worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
}
|
||||
|
||||
|
||||
|
@ -358,7 +358,7 @@ StorePathSet RemoteStore::querySubstitutablePaths(const StorePathSet & paths)
|
|||
return res;
|
||||
} else {
|
||||
conn->to << wopQuerySubstitutablePaths;
|
||||
nix::worker_proto::write(*this, conn->to, paths);
|
||||
worker_proto::write(*this, conn->to, paths);
|
||||
conn.processStderr();
|
||||
return worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ void write(const Store & store, Sink & out, const std::optional<T> & optVal)
|
|||
{
|
||||
out << (uint64_t) (optVal ? 1 : 0);
|
||||
if (optVal)
|
||||
nix::worker_proto::write(store, out, *optVal);
|
||||
worker_proto::write(store, out, *optVal);
|
||||
}
|
||||
|
||||
/* Specialization which uses and empty string for the empty case, taking
|
||||
|
|
|
@ -822,7 +822,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
|||
case cmdQueryValidPaths: {
|
||||
bool lock = readInt(in);
|
||||
bool substitute = readInt(in);
|
||||
auto paths = nix::worker_proto::read(*store, in, Phantom<StorePathSet> {});
|
||||
auto paths = worker_proto::read(*store, in, Phantom<StorePathSet> {});
|
||||
if (lock && writeAllowed)
|
||||
for (auto & path : paths)
|
||||
store->addTempRoot(path);
|
||||
|
@ -852,19 +852,19 @@ static void opServe(Strings opFlags, Strings opArgs)
|
|||
}
|
||||
}
|
||||
|
||||
nix::worker_proto::write(*store, out, store->queryValidPaths(paths));
|
||||
worker_proto::write(*store, out, store->queryValidPaths(paths));
|
||||
break;
|
||||
}
|
||||
|
||||
case cmdQueryPathInfos: {
|
||||
auto paths = nix::worker_proto::read(*store, in, Phantom<StorePathSet> {});
|
||||
auto paths = worker_proto::read(*store, in, Phantom<StorePathSet> {});
|
||||
// !!! Maybe we want a queryPathInfos?
|
||||
for (auto & i : paths) {
|
||||
try {
|
||||
auto info = store->queryPathInfo(i);
|
||||
out << store->printStorePath(info->path)
|
||||
<< (info->deriver ? store->printStorePath(*info->deriver) : "");
|
||||
nix::worker_proto::write(*store, out, info->references);
|
||||
worker_proto::write(*store, out, info->references);
|
||||
// !!! Maybe we want compression?
|
||||
out << info->narSize // downloadSize
|
||||
<< info->narSize;
|
||||
|
@ -892,7 +892,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
|||
|
||||
case cmdExportPaths: {
|
||||
readInt(in); // obsolete
|
||||
store->exportPaths(nix::worker_proto::read(*store, in, Phantom<StorePathSet> {}), out);
|
||||
store->exportPaths(worker_proto::read(*store, in, Phantom<StorePathSet> {}), out);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -941,9 +941,9 @@ static void opServe(Strings opFlags, Strings opArgs)
|
|||
case cmdQueryClosure: {
|
||||
bool includeOutputs = readInt(in);
|
||||
StorePathSet closure;
|
||||
store->computeFSClosure(nix::worker_proto::read(*store, in, Phantom<StorePathSet> {}),
|
||||
store->computeFSClosure(worker_proto::read(*store, in, Phantom<StorePathSet> {}),
|
||||
closure, false, includeOutputs);
|
||||
nix::worker_proto::write(*store, out, closure);
|
||||
worker_proto::write(*store, out, closure);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -958,7 +958,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
|||
};
|
||||
if (deriver != "")
|
||||
info.deriver = store->parseStorePath(deriver);
|
||||
info.references = nix::worker_proto::read(*store, in, Phantom<StorePathSet> {});
|
||||
info.references = worker_proto::read(*store, in, Phantom<StorePathSet> {});
|
||||
in >> info.registrationTime >> info.narSize >> info.ultimate;
|
||||
info.sigs = readStrings<StringSet>(in);
|
||||
info.ca = parseContentAddressOpt(readString(in));
|
||||
|
|
Loading…
Reference in a new issue