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;