forked from lix-project/hydra
Fix build
This commit is contained in:
parent
6c9e407bee
commit
7985757a1d
|
@ -270,7 +270,7 @@ int main(int argc, char * * argv)
|
||||||
|
|
||||||
return handleExceptions(argv[0], [&]() {
|
return handleExceptions(argv[0], [&]() {
|
||||||
|
|
||||||
auto config = std::make_unique<::Config>();
|
auto config = std::make_unique<HydraConfig>();
|
||||||
|
|
||||||
auto nrWorkers = config->getIntOption("evaluator_workers", 1);
|
auto nrWorkers = config->getIntOption("evaluator_workers", 1);
|
||||||
maxMemorySize = config->getIntOption("evaluator_max_memory_size", 4096);
|
maxMemorySize = config->getIntOption("evaluator_max_memory_size", 4096);
|
||||||
|
@ -472,11 +472,7 @@ int main(int argc, char * * argv)
|
||||||
auto h = hashDerivationModulo(*store, drv, true);
|
auto h = hashDerivationModulo(*store, drv, true);
|
||||||
auto outPath = store->makeOutputPath("out", h, drvName);
|
auto outPath = store->makeOutputPath("out", h, drvName);
|
||||||
drv.env["out"] = store->printStorePath(outPath);
|
drv.env["out"] = store->printStorePath(outPath);
|
||||||
drv.outputs.insert_or_assign("out", DerivationOutput {
|
drv.outputs.insert_or_assign("out", DerivationOutput { .path = outPath });
|
||||||
.path = outPath,
|
|
||||||
.hashAlgo = "",
|
|
||||||
.hash = ""
|
|
||||||
});
|
|
||||||
auto newDrvPath = store->printStorePath(writeDerivation(store, drv, drvName));
|
auto newDrvPath = store->printStorePath(writeDerivation(store, drv, drvName));
|
||||||
|
|
||||||
debug("rewrote aggregate derivation %s -> %s", drvPath, newDrvPath);
|
debug("rewrote aggregate derivation %s -> %s", drvPath, newDrvPath);
|
||||||
|
|
|
@ -24,7 +24,7 @@ enum class EvaluationStyle
|
||||||
|
|
||||||
struct Evaluator
|
struct Evaluator
|
||||||
{
|
{
|
||||||
std::unique_ptr<Config> config;
|
std::unique_ptr<HydraConfig> config;
|
||||||
|
|
||||||
nix::Pool<Connection> dbPool;
|
nix::Pool<Connection> dbPool;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ struct Evaluator
|
||||||
const time_t notTriggered = std::numeric_limits<time_t>::max();
|
const time_t notTriggered = std::numeric_limits<time_t>::max();
|
||||||
|
|
||||||
Evaluator()
|
Evaluator()
|
||||||
: config(std::make_unique<::Config>())
|
: config(std::make_unique<HydraConfig>())
|
||||||
, maxEvals(std::max((size_t) 1, (size_t) config->getIntOption("max_concurrent_evals", 4)))
|
, maxEvals(std::max((size_t) 1, (size_t) config->getIntOption("max_concurrent_evals", 4)))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ std::string getEnvOrDie(const std::string & key)
|
||||||
|
|
||||||
|
|
||||||
State::State()
|
State::State()
|
||||||
: config(std::make_unique<::Config>())
|
: config(std::make_unique<HydraConfig>())
|
||||||
, maxUnsupportedTime(config->getIntOption("max_unsupported_time", 0))
|
, maxUnsupportedTime(config->getIntOption("max_unsupported_time", 0))
|
||||||
, dbPool(config->getIntOption("max_db_connections", 128))
|
, dbPool(config->getIntOption("max_db_connections", 128))
|
||||||
, memoryTokens(config->getIntOption("nar_buffer_size", getMemSize() / 2))
|
, memoryTokens(config->getIntOption("nar_buffer_size", getMemSize() / 2))
|
||||||
|
|
|
@ -272,7 +272,7 @@ bool State::getQueuedBuilds(Connection & conn,
|
||||||
try {
|
try {
|
||||||
createBuild(build);
|
createBuild(build);
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
e.addPrefix(fmt("while loading build %1%: ", build->id));
|
e.addTrace({}, hintfmt("while loading build %d: ", build->id));
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,8 +458,7 @@ Step::ptr State::createStep(ref<Store> destStore,
|
||||||
for (auto & i : step->drv->outputs)
|
for (auto & i : step->drv->outputs)
|
||||||
if (!destStore->isValidPath(i.second.path)) {
|
if (!destStore->isValidPath(i.second.path)) {
|
||||||
valid = false;
|
valid = false;
|
||||||
missing.insert_or_assign(i.first,
|
missing.insert_or_assign(i.first, i.second);
|
||||||
DerivationOutput { i.second.path, i.second.hashAlgo, i.second.hash });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to copy the missing paths from the local store or from
|
/* Try to copy the missing paths from the local store or from
|
||||||
|
|
|
@ -292,14 +292,14 @@ struct Machine
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Config;
|
class HydraConfig;
|
||||||
|
|
||||||
|
|
||||||
class State
|
class State
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::unique_ptr<Config> config;
|
std::unique_ptr<HydraConfig> config;
|
||||||
|
|
||||||
// FIXME: Make configurable.
|
// FIXME: Make configurable.
|
||||||
const unsigned int maxTries = 5;
|
const unsigned int maxTries = 5;
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
|
|
||||||
struct Config
|
struct HydraConfig
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> options;
|
std::map<std::string, std::string> options;
|
||||||
|
|
||||||
Config()
|
HydraConfig()
|
||||||
{
|
{
|
||||||
using namespace nix;
|
using namespace nix;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue