mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
Merge remote-tracking branch 'upstream/master' into path-info
This commit is contained in:
commit
1b6cf0d5f5
36 changed files with 289 additions and 224 deletions
|
|
@ -52,13 +52,13 @@ void write(const Store & store, Sink & out, const ContentAddress & ca)
|
|||
}
|
||||
|
||||
|
||||
BuildableReq read(const Store & store, Source & from, Phantom<BuildableReq> _)
|
||||
DerivedPath read(const Store & store, Source & from, Phantom<DerivedPath> _)
|
||||
{
|
||||
auto s = readString(from);
|
||||
return BuildableReq::parse(store, s);
|
||||
return DerivedPath::parse(store, s);
|
||||
}
|
||||
|
||||
void write(const Store & store, Sink & out, const BuildableReq & req)
|
||||
void write(const Store & store, Sink & out, const DerivedPath & req)
|
||||
{
|
||||
out << req.to_string(store);
|
||||
}
|
||||
|
|
@ -671,14 +671,14 @@ std::optional<const Realisation> RemoteStore::queryRealisation(const DrvOutput &
|
|||
return {Realisation{.id = id, .outPath = *outPaths.begin()}};
|
||||
}
|
||||
|
||||
static void writeBuildableReqs(RemoteStore & store, ConnectionHandle & conn, const std::vector<BuildableReq> & reqs)
|
||||
static void writeDerivedPaths(RemoteStore & store, ConnectionHandle & conn, const std::vector<DerivedPath> & reqs)
|
||||
{
|
||||
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 29) {
|
||||
worker_proto::write(store, conn->to, reqs);
|
||||
} else {
|
||||
Strings ss;
|
||||
for (auto & p : reqs) {
|
||||
auto sOrDrvPath = StorePathWithOutputs::tryFromBuildableReq(p);
|
||||
auto sOrDrvPath = StorePathWithOutputs::tryFromDerivedPath(p);
|
||||
std::visit(overloaded {
|
||||
[&](StorePathWithOutputs s) {
|
||||
ss.push_back(s.to_string(store));
|
||||
|
|
@ -695,12 +695,12 @@ static void writeBuildableReqs(RemoteStore & store, ConnectionHandle & conn, con
|
|||
}
|
||||
}
|
||||
|
||||
void RemoteStore::buildPaths(const std::vector<BuildableReq> & drvPaths, BuildMode buildMode)
|
||||
void RemoteStore::buildPaths(const std::vector<DerivedPath> & drvPaths, BuildMode buildMode)
|
||||
{
|
||||
auto conn(getConnection());
|
||||
conn->to << wopBuildPaths;
|
||||
assert(GET_PROTOCOL_MINOR(conn->daemonVersion) >= 13);
|
||||
writeBuildableReqs(*this, conn, drvPaths);
|
||||
writeDerivedPaths(*this, conn, drvPaths);
|
||||
if (GET_PROTOCOL_MINOR(conn->daemonVersion) >= 15)
|
||||
conn->to << buildMode;
|
||||
else
|
||||
|
|
@ -839,7 +839,7 @@ void RemoteStore::addSignatures(const StorePath & storePath, const StringSet & s
|
|||
}
|
||||
|
||||
|
||||
void RemoteStore::queryMissing(const std::vector<BuildableReq> & targets,
|
||||
void RemoteStore::queryMissing(const std::vector<DerivedPath> & targets,
|
||||
StorePathSet & willBuild, StorePathSet & willSubstitute, StorePathSet & unknown,
|
||||
uint64_t & downloadSize, uint64_t & narSize)
|
||||
{
|
||||
|
|
@ -850,7 +850,7 @@ void RemoteStore::queryMissing(const std::vector<BuildableReq> & targets,
|
|||
// to prevent a deadlock.
|
||||
goto fallback;
|
||||
conn->to << wopQueryMissing;
|
||||
writeBuildableReqs(*this, conn, targets);
|
||||
writeDerivedPaths(*this, conn, targets);
|
||||
conn.processStderr();
|
||||
willBuild = worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
willSubstitute = worker_proto::read(*this, conn->from, Phantom<StorePathSet> {});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue