hydra-queue-runner: Write directly to a binary cache

This commit is contained in:
Eelco Dolstra
2016-02-15 21:10:29 +01:00
parent e46acbf05b
commit 2d0dd7fb49
9 changed files with 463 additions and 34 deletions

View File

@ -7,6 +7,7 @@
#include "state.hh"
#include "build-result.hh"
#include "local-binary-cache.hh"
#include "shared.hh"
#include "globals.hh"
@ -24,6 +25,18 @@ State::State()
}
ref<Store> State::getLocalStore()
{
return openStore(); // FIXME: pool
}
ref<Store> State::getDestStore()
{
return make_ref<LocalBinaryCache>(getLocalStore(), "/tmp/binary-cache");
}
void State::parseMachines(const std::string & contents)
{
Machines newMachines, oldMachines;
@ -94,7 +107,8 @@ void State::monitorMachinesFile()
getEnv("NIX_REMOTE_SYSTEMS", pathExists(defaultMachinesFile) ? defaultMachinesFile : ""), ":");
if (machinesFiles.empty()) {
parseMachines("localhost " + settings.thisSystem
parseMachines("localhost " +
(settings.thisSystem == "x86_64-linux" ? "x86_64-linux,i686-linux" : settings.thisSystem)
+ " - " + std::to_string(settings.maxBuildJobs) + " 1");
return;
}