Merge pull request #1222 from Ma27/nix-2.9

flake: Update Nix to 2.9.1
This commit is contained in:
Eelco Dolstra 2022-06-16 15:06:11 +02:00 committed by GitHub
commit fb26435fe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 13 deletions

View file

@ -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": {

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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;
{ {