diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index e6be7b10..45ebd695 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -116,11 +116,12 @@ static void copyClosureTo(ref destStore, static void copyClosureFrom(ref destStore, - FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived) + FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived, + std::shared_ptr accessor) { to << cmdExportPaths << 0 << paths; to.flush(); - destStore->importPaths(false, from); + destStore->importPaths(false, from, accessor); for (auto & p : paths) bytesReceived += destStore->queryPathInfo(p).narSize; @@ -297,9 +298,11 @@ void State::buildRemote(ref destStore, outputs.insert(output.second.path); MaintainCount mc(nrStepsCopyingFrom); + result.accessor = destStore->getFSAccessor(); + auto now1 = std::chrono::steady_clock::now(); - copyClosureFrom(destStore, from, to, outputs, bytesReceived); + copyClosureFrom(destStore, from, to, outputs, bytesReceived, result.accessor); auto now2 = std::chrono::steady_clock::now(); diff --git a/src/hydra-queue-runner/builder.cc b/src/hydra-queue-runner/builder.cc index 79566c4c..b8cb3c87 100644 --- a/src/hydra-queue-runner/builder.cc +++ b/src/hydra-queue-runner/builder.cc @@ -126,7 +126,8 @@ bool State::doBuildStep(nix::ref destStore, Step::ptr step, result.errorMsg = e.msg(); } - if (result.success()) res = getBuildOutput(destStore, destStore->getFSAccessor(), step->drv); + if (result.success()) + res = getBuildOutput(destStore, ref(result.accessor), step->drv); } time_t stepStopTime = time(0); diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index 01dfd650..c1a5cfb6 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -53,6 +53,7 @@ struct RemoteResult : nix::BuildResult time_t startTime = 0, stopTime = 0; unsigned int overhead = 0; nix::Path logFile; + std::shared_ptr accessor; bool canRetry() {