From 8722927c085e4e5a460d5d7cf73d8ac0161af4fd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 28 Jul 2020 13:46:57 +0200 Subject: [PATCH] Copy paths in the right order --- src/hydra-queue-runner/build-remote.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index b7d5ff85..356e8dea 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -125,7 +125,7 @@ static void copyClosureTo(std::timed_mutex & sendMutex, ref destStore, // FIXME: use Store::topoSortPaths(). -StorePaths topoSortPaths(const std::map & paths) +StorePaths reverseTopoSortPaths(const std::map & paths) { StorePaths sorted; StorePathSet visited; @@ -150,8 +150,6 @@ StorePaths topoSortPaths(const std::map & paths) for (auto & i : paths) dfsVisit(i.first); - std::reverse(sorted.begin(), sorted.end()); - return sorted; } @@ -468,7 +466,7 @@ void State::buildRemote(ref destStore, printMsg(lvlDebug, "copying outputs of ā€˜%sā€™ from ā€˜%sā€™ (%d bytes)", localStore->printStorePath(step->drvPath), machine->sshName, totalNarSize); - auto pathsSorted = topoSortPaths(infos); + auto pathsSorted = reverseTopoSortPaths(infos); for (auto & path : pathsSorted) { auto & info = infos.find(path)->second;