forked from lix-project/hydra
Prevent download of NARs we just uploaded
This commit is contained in:
parent
02190b0fef
commit
6d741d2ffa
|
@ -116,11 +116,12 @@ static void copyClosureTo(ref<Store> destStore,
|
||||||
|
|
||||||
|
|
||||||
static void copyClosureFrom(ref<Store> destStore,
|
static void copyClosureFrom(ref<Store> destStore,
|
||||||
FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived)
|
FdSource & from, FdSink & to, const PathSet & paths, counter & bytesReceived,
|
||||||
|
std::shared_ptr<FSAccessor> accessor)
|
||||||
{
|
{
|
||||||
to << cmdExportPaths << 0 << paths;
|
to << cmdExportPaths << 0 << paths;
|
||||||
to.flush();
|
to.flush();
|
||||||
destStore->importPaths(false, from);
|
destStore->importPaths(false, from, accessor);
|
||||||
|
|
||||||
for (auto & p : paths)
|
for (auto & p : paths)
|
||||||
bytesReceived += destStore->queryPathInfo(p).narSize;
|
bytesReceived += destStore->queryPathInfo(p).narSize;
|
||||||
|
@ -297,9 +298,11 @@ void State::buildRemote(ref<Store> destStore,
|
||||||
outputs.insert(output.second.path);
|
outputs.insert(output.second.path);
|
||||||
MaintainCount mc(nrStepsCopyingFrom);
|
MaintainCount mc(nrStepsCopyingFrom);
|
||||||
|
|
||||||
|
result.accessor = destStore->getFSAccessor();
|
||||||
|
|
||||||
auto now1 = std::chrono::steady_clock::now();
|
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();
|
auto now2 = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,8 @@ bool State::doBuildStep(nix::ref<Store> destStore, Step::ptr step,
|
||||||
result.errorMsg = e.msg();
|
result.errorMsg = e.msg();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.success()) res = getBuildOutput(destStore, destStore->getFSAccessor(), step->drv);
|
if (result.success())
|
||||||
|
res = getBuildOutput(destStore, ref<FSAccessor>(result.accessor), step->drv);
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t stepStopTime = time(0);
|
time_t stepStopTime = time(0);
|
||||||
|
|
|
@ -53,6 +53,7 @@ struct RemoteResult : nix::BuildResult
|
||||||
time_t startTime = 0, stopTime = 0;
|
time_t startTime = 0, stopTime = 0;
|
||||||
unsigned int overhead = 0;
|
unsigned int overhead = 0;
|
||||||
nix::Path logFile;
|
nix::Path logFile;
|
||||||
|
std::shared_ptr<nix::FSAccessor> accessor;
|
||||||
|
|
||||||
bool canRetry()
|
bool canRetry()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue