@@ -36,42 +36,6 @@ bool ::Machine::isLocalhost() const
36
36
37
37
namespace nix ::build_remote {
38
38
39
- static void copyClosureTo (
40
- ::Machine::Connection & conn,
41
- Store & destStore,
42
- const StorePathSet & paths,
43
- SubstituteFlag useSubstitutes = NoSubstitute)
44
- {
45
- StorePathSet closure;
46
- destStore.computeFSClosure (paths, closure);
47
-
48
- /* Send the "query valid paths" command with the "lock" option
49
- enabled. This prevents a race where the remote host
50
- garbage-collect paths that are already there. Optionally, ask
51
- the remote host to substitute missing paths. */
52
- // FIXME: substitute output pollutes our build log
53
- /* Get back the set of paths that are already valid on the remote
54
- host. */
55
- auto present = conn.store ->queryValidPaths (
56
- closure, true , useSubstitutes);
57
-
58
- if (present.size () == closure.size ()) return ;
59
-
60
- auto sorted = destStore.topoSortPaths (closure);
61
-
62
- StorePathSet missing;
63
- for (auto i = sorted.rbegin (); i != sorted.rend (); ++i)
64
- if (!present.count (*i)) missing.insert (*i);
65
-
66
- printMsg (lvlDebug, " sending %d missing paths" , missing.size ());
67
-
68
- std::unique_lock<std::timed_mutex> sendLock (conn.machine ->state ->sendLock ,
69
- std::chrono::seconds (600 ));
70
-
71
- conn.store ->addMultipleToStoreLegacy (destStore, missing);
72
- }
73
-
74
-
75
39
// FIXME: use Store::topoSortPaths().
76
40
static StorePaths reverseTopoSortPaths (const std::map<StorePath, UnkeyedValidPathInfo> & paths)
77
41
{
@@ -163,13 +127,13 @@ static BasicDerivation sendInputs(
163
127
auto now1 = std::chrono::steady_clock::now ();
164
128
165
129
/* Copy the input closure. */
166
- if (conn. machine -> isLocalhost ()) {
167
- StorePathSet closure;
168
- destStore. computeFSClosure (basicDrv. inputSrcs , closure);
169
- copyPaths (destStore, localStore, closure, NoRepair, NoCheckSigs, NoSubstitute);
170
- } else {
171
- copyClosureTo (conn, destStore, basicDrv. inputSrcs , Substitute);
172
- }
130
+ copyClosure (
131
+ destStore,
132
+ conn. machine -> isLocalhost () ? localStore : *conn. store ,
133
+ basicDrv. inputSrcs ,
134
+ NoRepair,
135
+ NoCheckSigs,
136
+ Substitute);
173
137
174
138
auto now2 = std::chrono::steady_clock::now ();
175
139
0 commit comments