diff --git a/lix/legacy/nix-build.cc b/lix/legacy/nix-build.cc index 9103b3c43..fd09d8945 100644 --- a/lix/legacy/nix-build.cc +++ b/lix/legacy/nix-build.cc @@ -291,7 +291,7 @@ static void main_nix_build(AsyncIoRoot & aio, std::string programName, Strings a takesNixShellAttr(vRoot) ? *autoArgsWithInNixShell : *autoArgs, vRoot ).first); - state->forceValue(v, v.determinePos(noPos)); + state->forceValue(v, noPos); getDerivations( *state, v, diff --git a/lix/legacy/nix-instantiate.cc b/lix/legacy/nix-instantiate.cc index 26da93c69..74db1c76b 100644 --- a/lix/legacy/nix-instantiate.cc +++ b/lix/legacy/nix-instantiate.cc @@ -39,7 +39,7 @@ void processExpr(EvalState & state, const Strings & attrPaths, for (auto & i : attrPaths) { Value & v(*findAlongAttrPath(state, i, autoArgs, vRoot).first); - state.forceValue(v, v.determinePos(noPos)); + state.forceValue(v, noPos); NixStringContext context; if (evalOnly) { diff --git a/lix/legacy/user-env.cc b/lix/legacy/user-env.cc index bc931c20a..5f147ddbe 100644 --- a/lix/legacy/user-env.cc +++ b/lix/legacy/user-env.cc @@ -112,7 +112,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems, /* Evaluate it. */ debug("evaluating user environment builder"); - state.forceValue(topLevel, topLevel.determinePos(noPos)); + state.forceValue(topLevel, noPos); NixStringContext context; Attr & aDrvPath(*topLevel.attrs->find(state.ctx.s.drvPath)); auto topLevelDrv = state.coerceToStorePath(aDrvPath.pos, *aDrvPath.value, context, ""); diff --git a/lix/libcmd/repl.cc b/lix/libcmd/repl.cc index 880fb419e..91b60eba7 100644 --- a/lix/libcmd/repl.cc +++ b/lix/libcmd/repl.cc @@ -869,7 +869,7 @@ ProcessLineResult NixRepl::processLine(std::string line) Value v; e->eval(state, *env, v); (void) e.release(); // NOLINT(bugprone-unused-return-value): leak because of thunk references - state.forceValue(v, v.determinePos(noPos)); + state.forceValue(v, noPos); printValue(std::cout, v, 1); std::cout << std::endl; } @@ -1056,7 +1056,7 @@ Value * NixRepl::replInitInfo() void NixRepl::addAttrsToScope(Value & attrs) { - state.forceAttrs(attrs, attrs.determinePos(noPos), "while evaluating an attribute set to be merged in the global scope"); + state.forceAttrs(attrs, noPos, "while evaluating an attribute set to be merged in the global scope"); if (displ + attrs.attrs->size() >= envSize) throw Error("environment full; cannot add more variables"); @@ -1115,7 +1115,7 @@ void NixRepl::evalString(std::string s, Value & v) { Expr & e = parseString(s); e.eval(state, *env, v); - state.forceValue(v, v.determinePos(noPos)); + state.forceValue(v, noPos); } Value * NixRepl::evalFile(SourcePath & path) @@ -1123,7 +1123,7 @@ Value * NixRepl::evalFile(SourcePath & path) auto & expr = evaluator.parseExprFromFile(evaluator.paths.checkSourcePath(path), staticEnv); Value * result(evaluator.mem.allocValue()); expr.eval(state, *env, *result); - state.forceValue(*result, result->determinePos(noPos)); + state.forceValue(*result, noPos); return result; } diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc index 250573ede..0769eef20 100644 --- a/lix/libexpr/eval.cc +++ b/lix/libexpr/eval.cc @@ -1136,7 +1136,7 @@ void ExprSet::eval(EvalState & state, Env & env, Value & v) Hence we need __overrides.) */ if (hasOverrides) { Value * vOverrides = (*v.attrs)[overrides->second.displ].value; - state.forceAttrs(*vOverrides, vOverrides->determinePos(noPos), "while evaluating the `__overrides` attribute"); + state.forceAttrs(*vOverrides, noPos, "while evaluating the `__overrides` attribute"); Bindings * newBnds = state.ctx.mem.allocBindings(v.attrs->capacity() + vOverrides->attrs->size()); for (auto & i : *v.attrs) newBnds->push_back(i); @@ -2137,7 +2137,7 @@ void EvalState::forceValueDeep(Value & v) recurse = [&](Value & v) { if (!seen.insert(&v).second) return; - forceValue(v, v.determinePos(noPos)); + forceValue(v, noPos); if (v.type() == nAttrs) { for (auto & i : *v.attrs) diff --git a/lix/libexpr/get-drvs.cc b/lix/libexpr/get-drvs.cc index f44a4e292..cedfd05aa 100644 --- a/lix/libexpr/get-drvs.cc +++ b/lix/libexpr/get-drvs.cc @@ -286,7 +286,7 @@ StringSet DrvInfo::queryMetaNames(EvalState & state) bool DrvInfo::checkMeta(EvalState & state, Value & v) { - state.forceValue(v, v.determinePos(noPos)); + state.forceValue(v, noPos); if (v.type() == nList) { for (auto elem : v.listItems()) if (!checkMeta(state, *elem)) return false; @@ -375,7 +375,7 @@ static bool getDerivation(EvalState & state, Value & v, bool ignoreAssertionFailures) { try { - state.forceValue(v, v.determinePos(noPos)); + state.forceValue(v, noPos); if (!state.isDerivation(v)) return true; DrvInfo drv(attrPath, v.attrs); diff --git a/lix/libexpr/primops.cc b/lix/libexpr/primops.cc index 3e8292599..4be24e789 100644 --- a/lix/libexpr/primops.cc +++ b/lix/libexpr/primops.cc @@ -626,14 +626,14 @@ static RegisterPrimOp primop_addErrorContext(PrimOp { static void prim_ceil(EvalState & state, const PosIdx pos, Value * * args, Value & v) { - auto value = state.forceFloat(*args[0], args[0]->determinePos(pos), + auto value = state.forceFloat(*args[0], pos, "while evaluating the first argument passed to builtins.ceil"); v.mkInt(ceil(value)); } static void prim_floor(EvalState & state, const PosIdx pos, Value * * args, Value & v) { - auto value = state.forceFloat(*args[0], args[0]->determinePos(pos), "while evaluating the first argument passed to builtins.floor"); + auto value = state.forceFloat(*args[0], pos, "while evaluating the first argument passed to builtins.floor"); v.mkInt(floor(value)); } @@ -2346,7 +2346,7 @@ static void prim_concatMap(EvalState & state, const PosIdx pos, Value * * args, for (unsigned int n = 0; n < nrLists; ++n) { Value * vElem = args[1]->listElems()[n]; state.callFunction(*args[0], *vElem, lists[n], pos); - state.forceList(lists[n], lists[n].determinePos(args[0]->determinePos(pos)), "while evaluating the return value of the function passed to builtins.concatMap"); + state.forceList(lists[n], pos, "while evaluating the return value of the function passed to builtins.concatMap"); len += lists[n].listSize(); } diff --git a/lix/libexpr/print.cc b/lix/libexpr/print.cc index 228c5a6dc..01a9dcb67 100644 --- a/lix/libexpr/print.cc +++ b/lix/libexpr/print.cc @@ -266,7 +266,7 @@ private: if (options.force) { // The item is going to be forced during printing anyway, but we need its type now. - state.forceValue(*item, item->determinePos(noPos)); + state.forceValue(*item, noPos); } // Pretty-print single-item attrsets only if they contain nested @@ -339,7 +339,7 @@ private: if (options.force) { // The item is going to be forced during printing anyway, but we need its type now. - state.forceValue(*item, item->determinePos(noPos)); + state.forceValue(*item, noPos); } // Pretty-print single-item lists only if they contain nested @@ -479,7 +479,7 @@ private: try { if (options.force) { - state.forceValue(v, v.determinePos(noPos)); + state.forceValue(v, noPos); } switch (v.type()) {