diff --git a/src/hydra-queue-runner/build-remote.cc b/src/hydra-queue-runner/build-remote.cc index 4111a8fb..09e87133 100644 --- a/src/hydra-queue-runner/build-remote.cc +++ b/src/hydra-queue-runner/build-remote.cc @@ -273,7 +273,7 @@ static BuildResult performBuild( auto drvOutput = DrvOutput { outputHash, outputName }; successP->builtOutputs.insert_or_assign( std::move(outputName), - Realisation { drvOutput, *outputPath }); + Realisation { {.outPath = *outputPath}, drvOutput }); } } } diff --git a/src/hydra-queue-runner/hydra-queue-runner.cc b/src/hydra-queue-runner/hydra-queue-runner.cc index 7cdc04b3..1dada304 100644 --- a/src/hydra-queue-runner/hydra-queue-runner.cc +++ b/src/hydra-queue-runner/hydra-queue-runner.cc @@ -537,12 +537,12 @@ void State::notifyBuildFinished(pqxx::work & txn, BuildID buildId, std::shared_ptr State::acquireGlobalLock() { - Path lockPath = hydraData + "/queue-runner/lock"; + auto lockPath = std::filesystem::path(hydraData) / "queue-runner/lock"; - createDirs(dirOf(lockPath)); + createDirs(lockPath.parent_path()); auto lock = std::make_shared(); - if (!lock->lockPaths(PathSet({lockPath}), "", false)) return 0; + if (!lock->lockPaths({lockPath}, "", false)) return 0; return lock; } diff --git a/src/hydra-queue-runner/queue-monitor.cc b/src/hydra-queue-runner/queue-monitor.cc index 7630230c..1a7c7898 100644 --- a/src/hydra-queue-runner/queue-monitor.cc +++ b/src/hydra-queue-runner/queue-monitor.cc @@ -1,5 +1,6 @@ #include "state.hh" #include "hydra-build-result.hh" +#include #include #include #include @@ -487,24 +488,24 @@ Step::ptr State::createStep(ref destStore, it's not runnable yet, and other threads won't make it runnable while step->created == false. */ step->drv = std::make_unique(localStore->readDerivation(drvPath)); - { - try { - step->drvOptions = std::make_unique( - DerivationOptions::fromStructuredAttrs( - step->drv->env, - step->drv->structuredAttrs ? &*step->drv->structuredAttrs : nullptr)); - } catch (Error & e) { - e.addTrace({}, "while parsing derivation '%s'", localStore->printStorePath(drvPath)); - throw; - } + DerivationOptions drvOptions; + try { + drvOptions = derivationOptionsFromStructuredAttrs( + *localStore, + step->drv->inputDrvs, + step->drv->env, + get(step->drv->structuredAttrs)); + } catch (Error & e) { + e.addTrace({}, "while parsing derivation '%s'", localStore->printStorePath(drvPath)); + throw; } - step->preferLocalBuild = step->drvOptions->willBuildLocally(*localStore, *step->drv); + step->preferLocalBuild = drvOptions.willBuildLocally(*localStore, *step->drv); step->isDeterministic = getOr(step->drv->env, "isDetermistic", "0") == "1"; step->systemType = step->drv->platform; { - StringSet features = step->requiredSystemFeatures = step->drvOptions->getRequiredSystemFeatures(*step->drv); + StringSet features = step->requiredSystemFeatures = drvOptions.getRequiredSystemFeatures(*step->drv); if (step->preferLocalBuild) features.insert("local"); if (!features.empty()) { diff --git a/src/hydra-queue-runner/state.hh b/src/hydra-queue-runner/state.hh index eee042e2..054d989b 100644 --- a/src/hydra-queue-runner/state.hh +++ b/src/hydra-queue-runner/state.hh @@ -172,7 +172,6 @@ struct Step nix::StorePath drvPath; std::unique_ptr drv; - std::unique_ptr drvOptions; nix::StringSet requiredSystemFeatures; bool preferLocalBuild; bool isDeterministic;