From d38ef4492ef78033f721355dc6879f899825f1ba Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 29 Dec 2020 17:25:51 -0600 Subject: [PATCH] Update for Nix Value::type API changes This updates hydra to be compatible with Nix https://github.com/NixOS/nix/pull/4355. Along with https://github.com/NixOS/hydra/pull/840 needed for https://github.com/NixOS/nixpkgs/pull/107909 /cc @edolstra --- src/hydra-eval-jobs/hydra-eval-jobs.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hydra-eval-jobs/hydra-eval-jobs.cc b/src/hydra-eval-jobs/hydra-eval-jobs.cc index 600d4670..e6f9a4d4 100644 --- a/src/hydra-eval-jobs/hydra-eval-jobs.cc +++ b/src/hydra-eval-jobs/hydra-eval-jobs.cc @@ -78,12 +78,12 @@ static std::string queryMetaStrings(EvalState & state, DrvInfo & drv, const stri rec = [&](Value & v) { state.forceValue(v); - if (v.type == tString) + if (v.type() == nString) res.push_back(v.string.s); else if (v.isList()) for (unsigned int n = 0; n < v.listSize(); ++n) rec(*v.listElems()[n]); - else if (v.type == tAttrs) { + else if (v.type() == nAttrs) { auto a = v.attrs->find(state.symbols.create(subAttribute)); if (a != v.attrs->end()) res.push_back(state.forceString(*a->value)); @@ -201,7 +201,7 @@ static void worker( for (unsigned int n = 0; n < a->value->listSize(); ++n) { auto v = a->value->listElems()[n]; state.forceValue(*v); - if (v->type == tString) + if (v->type() == nString) job["namedConstituents"].push_back(state.forceStringNoCtx(*v)); } } @@ -224,7 +224,7 @@ static void worker( reply["job"] = std::move(job); } - else if (v->type == tAttrs) { + else if (v->type() == nAttrs) { auto attrs = nlohmann::json::array(); StringSet ss; for (auto & i : v->attrs->lexicographicOrder()) { @@ -238,7 +238,7 @@ static void worker( reply["attrs"] = std::move(attrs); } - else if (v->type == tNull) + else if (v->type() == nNull) ; else throw TypeError("attribute '%s' is %s, which is not supported", attrPath, showType(*v));