From 7985757a1dbb74926d5de0cf5efe46e10e46ca2c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 8 Jul 2020 12:50:02 +0200 Subject: [PATCH] Fix build --- src/hydra-eval-jobs/hydra-eval-jobs.cc | 8 ++------ src/hydra-evaluator/hydra-evaluator.cc | 4 ++-- src/hydra-queue-runner/hydra-queue-runner.cc | 2 +- src/hydra-queue-runner/queue-monitor.cc | 5 ++--- src/hydra-queue-runner/state.hh | 4 ++-- src/libhydra/hydra-config.hh | 4 ++-- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index dd69bb50..ff74c23e 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -270,7 +270,7 @@ int main(int argc, char * * argv) return handleExceptions(argv[0], [&]() { - auto config = std::make_unique<::Config>(); + auto config = std::make_unique(); auto nrWorkers = config->getIntOption("evaluator_workers", 1); 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 outPath = store->makeOutputPath("out", h, drvName); drv.env["out"] = store->printStorePath(outPath); - drv.outputs.insert_or_assign("out", DerivationOutput { - .path = outPath, - .hashAlgo = "", - .hash = "" - }); + drv.outputs.insert_or_assign("out", DerivationOutput { .path = outPath }); auto newDrvPath = store->printStorePath(writeDerivation(store, drv, drvName)); debug("rewrote aggregate derivation %s -> %s", drvPath, newDrvPath); diff --git a/src/hydra-evaluator/hydra-evaluator.cc b/src/hydra-evaluator/hydra-evaluator.cc index 2d7544d4..1cb93496 100644 --- a/src/hydra-evaluator/hydra-evaluator.cc +++ b/src/hydra-evaluator/hydra-evaluator.cc @@ -24,7 +24,7 @@ enum class EvaluationStyle struct Evaluator { - std::unique_ptr config; + std::unique_ptr config; nix::Pool dbPool; @@ -57,7 +57,7 @@ struct Evaluator const time_t notTriggered = std::numeric_limits::max(); Evaluator() - : config(std::make_unique<::Config>()) + : config(std::make_unique()) , maxEvals(std::max((size_t) 1, (size_t) config->getIntOption("max_concurrent_evals", 4))) { } diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 99e4f013..073af7ff 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -46,7 +46,7 @@ std::string getEnvOrDie(const std::string & key) State::State() - : config(std::make_unique<::Config>()) + : config(std::make_unique()) , maxUnsupportedTime(config->getIntOption("max_unsupported_time", 0)) , dbPool(config->getIntOption("max_db_connections", 128)) , memoryTokens(config->getIntOption("nar_buffer_size", getMemSize() / 2)) diff --git a/src/hydra-queue-runner/queue-monitor.cc b/src/hydra-queue-runner/queue-monitor.cc index 078fe604..24f4d04e 100644 --- a/src/hydra-queue-runner/queue-monitor.cc +++ b/src/hydra-queue-runner/queue-monitor.cc @@ -272,7 +272,7 @@ bool State::getQueuedBuilds(Connection & conn, try { createBuild(build); } catch (Error & e) { - e.addPrefix(fmt("while loading build %1%: ", build->id)); + e.addTrace({}, hintfmt("while loading build %d: ", build->id)); throw; } @@ -458,8 +458,7 @@ Step::ptr State::createStep(ref destStore, for (auto & i : step->drv->outputs) if (!destStore->isValidPath(i.second.path)) { valid = false; - missing.insert_or_assign(i.first, - DerivationOutput { i.second.path, i.second.hashAlgo, i.second.hash }); + missing.insert_or_assign(i.first, i.second); } /* Try to copy the missing paths from the local store or from diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index 025f5602..2447a6ff 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -292,14 +292,14 @@ struct Machine }; -class Config; +class HydraConfig; class State { private: - std::unique_ptr config; + std::unique_ptr config; // FIXME: Make configurable. const unsigned int maxTries = 5; diff --git a/src/libhydra/hydra-config.hh b/src/libhydra/hydra-config.hh index 98d73d47..bc989f74 100644 --- a/src/libhydra/hydra-config.hh +++ b/src/libhydra/hydra-config.hh @@ -4,11 +4,11 @@ #include "util.hh" -struct Config +struct HydraConfig { std::map options; - Config() + HydraConfig() { using namespace nix;