Skip to content

Commit

Permalink
Revert "Do not copy for both stores for now"
Browse files Browse the repository at this point in the history
As the revert commit's description says, we only want to remove this in
the preperatory branch, for NixOS#1316. In the
main branch, for NixOS#875, the change
shoudl be put back.

This revert puts it back.

This reverts commit 2ee0068.
  • Loading branch information
Ericson2314 committed Dec 7, 2023
1 parent 5b5f295 commit 049f608
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/hydra-queue-runner/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,20 @@ static void copyPathFromRemote(
const ValidPathInfo & info
)
{
// Why both stores? @thufschmitt says:
//
// > I think it's an easy (and terribly inefficient 😬) way of
// making sure that `localStore.queryRealisations` will succeed
// (which we IIRC we need later to get back some metadata about the
// path to put it in the db).
// >
// > To be honest, we shouldn't do that but instead carry the needed
// metadata in memory until the point where we need it (but that can
// come later once we're confident that this is at least correct)
//
// TODO make the above change to avoid copying excess data back and
// forth.
for (auto * store : {&destStore, &localStore}) {
/* Receive the NAR from the remote and add it to the
destination store. Meanwhile, extract all the info from the
NAR that getBuildOutput() needs. */
Expand All @@ -444,7 +458,8 @@ static void copyPathFromRemote(
extractNarData(tee, localStore.printStorePath(info.path), narMembers);
});

destStore.addToStore(info, *source2, NoRepair, NoCheckSigs);
store->addToStore(info, *source2, NoRepair, NoCheckSigs);
}
}

static void copyPathsFromRemote(
Expand Down

0 comments on commit 049f608

Please sign in to comment.