flake: Update Nix to 2.9.1
NOTE: I'm well-aware that we have to be careful with this to avoid new regressions on hydra.nixos.org, so this should only be merged after extensive testing from more people. Motivation: I updated Nix in my deployment to 2.9.1 and decided to also update Hydra in one go (and compile it against the newer Nix). Given that this also updates the C++ code in `hydra-{queue-runner,eval-jobs}` this patch might become useful in the future though.
This commit is contained in:
parent
cf9f38e43f
commit
5c01800fbe
12
flake.lock
12
flake.lock
|
@ -39,16 +39,18 @@
|
||||||
"nixpkgs-regression": "nixpkgs-regression"
|
"nixpkgs-regression": "nixpkgs-regression"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1649172203,
|
"lastModified": 1654014617,
|
||||||
"narHash": "sha256-Q3nYaXqbseDOvZrlePKeIrx0/KzqyrtNpxHIUbtFHuI=",
|
"narHash": "sha256-qNL3lQPBsnStkru3j1ajN/H+knXI+X3dku8/dBfSw3g=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"rev": "5fe4fe823c193cbb7bfa05a468de91eeab09058d",
|
"rev": "624e38aa43f304fbb78b4779172809add042b513",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nix",
|
"owner": "NixOS",
|
||||||
"type": "indirect"
|
"ref": "2.9.1",
|
||||||
|
"repo": "nix",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# even 2.7.0's Nixpkgs pin).
|
# even 2.7.0's Nixpkgs pin).
|
||||||
inputs.newNixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
inputs.newNixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
||||||
inputs.nixpkgs.follows = "nix/nixpkgs";
|
inputs.nixpkgs.follows = "nix/nixpkgs";
|
||||||
#inputs.nix.url = github:NixOS/nix/2.7.0;
|
inputs.nix.url = github:NixOS/nix/2.9.1;
|
||||||
|
|
||||||
outputs = { self, newNixpkgs, nixpkgs, nix }:
|
outputs = { self, newNixpkgs, nixpkgs, nix }:
|
||||||
let
|
let
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
bin_PROGRAMS = hydra-eval-jobs
|
bin_PROGRAMS = hydra-eval-jobs
|
||||||
|
|
||||||
hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc
|
hydra_eval_jobs_SOURCES = hydra-eval-jobs.cc
|
||||||
hydra_eval_jobs_LDADD = $(NIX_LIBS)
|
hydra_eval_jobs_LDADD = $(NIX_LIBS) -lnixcmd
|
||||||
hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra
|
hydra_eval_jobs_CXXFLAGS = $(NIX_CFLAGS) -I ../libhydra
|
||||||
|
|
|
@ -197,21 +197,21 @@ static void worker(
|
||||||
|
|
||||||
/* If this is an aggregate, then get its constituents. */
|
/* If this is an aggregate, then get its constituents. */
|
||||||
auto a = v->attrs->get(state.symbols.create("_hydraAggregate"));
|
auto a = v->attrs->get(state.symbols.create("_hydraAggregate"));
|
||||||
if (a && state.forceBool(*a->value, *a->pos)) {
|
if (a && state.forceBool(*a->value, a->pos)) {
|
||||||
auto a = v->attrs->get(state.symbols.create("constituents"));
|
auto a = v->attrs->get(state.symbols.create("constituents"));
|
||||||
if (!a)
|
if (!a)
|
||||||
throw EvalError("derivation must have a ‘constituents’ attribute");
|
throw EvalError("derivation must have a ‘constituents’ attribute");
|
||||||
|
|
||||||
|
|
||||||
PathSet context;
|
PathSet context;
|
||||||
state.coerceToString(*a->pos, *a->value, context, true, false);
|
state.coerceToString(a->pos, *a->value, context, true, false);
|
||||||
for (auto & i : context)
|
for (auto & i : context)
|
||||||
if (i.at(0) == '!') {
|
if (i.at(0) == '!') {
|
||||||
size_t index = i.find("!", 1);
|
size_t index = i.find("!", 1);
|
||||||
job["constituents"].push_back(std::string(i, index + 1));
|
job["constituents"].push_back(std::string(i, index + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
state.forceList(*a->value, *a->pos);
|
state.forceList(*a->value, a->pos);
|
||||||
for (unsigned int n = 0; n < a->value->listSize(); ++n) {
|
for (unsigned int n = 0; n < a->value->listSize(); ++n) {
|
||||||
auto v = a->value->listElems()[n];
|
auto v = a->value->listElems()[n];
|
||||||
state.forceValue(*v, noPos);
|
state.forceValue(*v, noPos);
|
||||||
|
@ -243,8 +243,8 @@ static void worker(
|
||||||
else if (v->type() == nAttrs) {
|
else if (v->type() == nAttrs) {
|
||||||
auto attrs = nlohmann::json::array();
|
auto attrs = nlohmann::json::array();
|
||||||
StringSet ss;
|
StringSet ss;
|
||||||
for (auto & i : v->attrs->lexicographicOrder()) {
|
for (auto & i : v->attrs->lexicographicOrder(state.symbols)) {
|
||||||
std::string name(i->name);
|
std::string name(state.symbols[i->name]);
|
||||||
if (name.find('.') != std::string::npos || name.find(' ') != std::string::npos) {
|
if (name.find('.') != std::string::npos || name.find(' ') != std::string::npos) {
|
||||||
printError("skipping job with illegal name '%s'", name);
|
printError("skipping job with illegal name '%s'", name);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -460,7 +460,7 @@ Step::ptr State::createStep(ref<Store> destStore,
|
||||||
step->parsedDrv = std::make_unique<ParsedDerivation>(drvPath, *step->drv);
|
step->parsedDrv = std::make_unique<ParsedDerivation>(drvPath, *step->drv);
|
||||||
|
|
||||||
step->preferLocalBuild = step->parsedDrv->willBuildLocally(*localStore);
|
step->preferLocalBuild = step->parsedDrv->willBuildLocally(*localStore);
|
||||||
step->isDeterministic = get(step->drv->env, "isDetermistic").value_or("0") == "1";
|
step->isDeterministic = getOr(step->drv->env, "isDetermistic", "0") == "1";
|
||||||
|
|
||||||
step->systemType = step->drv->platform;
|
step->systemType = step->drv->platform;
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue