Skip to content

Commit f3dddd6

Browse files
committed
build-remote: Add dependencies as temproots on the remote
Otherwise dependencies can be removed from under builds if the remote store runs a GC.
1 parent cee10d6 commit f3dddd6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/nix/build-remote/build-remote.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,15 @@ static int main_build_remote(int argc, char ** argv)
305305

306306
{
307307
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying dependencies to '%s'", storeUri));
308-
copyPaths(*store, *sshStore, store->parseStorePathSet(inputs), NoRepair, NoCheckSigs, substitute);
308+
309+
auto storePaths = store->parseStorePathSet(inputs);
310+
311+
/* We don't have goals on the remote tracking our dependencies as
312+
temp roots, so add them as temproots ourselves. */
313+
for (auto & path : storePaths)
314+
sshStore->addTempRoot(path);
315+
316+
copyPaths(*store, *sshStore, storePaths, NoRepair, NoCheckSigs, substitute);
309317
}
310318

311319
uploadLock = -1;

0 commit comments

Comments
 (0)