aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-02-04 00:33:13 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-02-04 00:33:13 +0100
commit4c755c3b3fc427afe192d223b37c288c88cc57d5 (patch)
tree2cf2973f2a6d1b1a204efc4adafee82bff95f7d7 /src/libcmd
parent1aa5994e6d7bfb32895264c3a2f1d94cc7272a72 (diff)
parent50efc5499a7d924828bed654be207a846c040fa0 (diff)
Merge branch 'issue-3505' of https://github.com/kamadorueda/nix
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/installables.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 0c2db0399..ec4f8f6f9 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -198,8 +198,9 @@ void SourceExprCommand::completeInstallable(std::string_view prefix)
prefix_ = "";
}
- Value &v1(*findAlongAttrPath(*state, prefix_, *autoArgs, root).first);
- state->forceValue(v1);
+ auto [v, pos] = findAlongAttrPath(*state, prefix_, *autoArgs, root);
+ Value &v1(*v);
+ state->forceValue(v1, pos);
Value v2;
state->autoCallFunction(*autoArgs, v1, v2);
@@ -446,7 +447,7 @@ struct InstallableAttrPath : InstallableValue
std::pair<Value *, Pos> toValue(EvalState & state) override
{
auto [vRes, pos] = findAlongAttrPath(state, attrPath, *cmd.getAutoArgs(state), **v);
- state.forceValue(*vRes);
+ state.forceValue(*vRes, pos);
return {vRes, pos};
}
@@ -496,7 +497,7 @@ Value * InstallableFlake::getFlakeOutputs(EvalState & state, const flake::Locked
auto aOutputs = vFlake->attrs->get(state.symbols.create("outputs"));
assert(aOutputs);
- state.forceValue(*aOutputs->value);
+ state.forceValue(*aOutputs->value, aOutputs->value->determinePos(noPos));
return aOutputs->value;
}
@@ -521,7 +522,7 @@ ref<eval_cache::EvalCache> openEvalCache(
auto vFlake = state.allocValue();
flake::callFlake(state, *lockedFlake, *vFlake);
- state.forceAttrs(*vFlake);
+ state.forceAttrs(*vFlake, noPos);
auto aOutputs = vFlake->attrs->get(state.symbols.create("outputs"));
assert(aOutputs);
@@ -608,7 +609,7 @@ std::pair<Value *, Pos> InstallableFlake::toValue(EvalState & state)
for (auto & attrPath : getActualAttrPaths()) {
try {
auto [v, pos] = findAlongAttrPath(state, attrPath, *emptyArgs, *vOutputs);
- state.forceValue(*v);
+ state.forceValue(*v, pos);
return {v, pos};
} catch (AttrPathNotFound & e) {
}