Skip to content

Commit

Permalink
Merge pull request #9915 from 9999years/evaluating-attribute-position
Browse files Browse the repository at this point in the history
Add position information to `while evaluating the attribute` errors in the debugger
  • Loading branch information
tomberek committed Feb 28, 2024
2 parents 90ec015 + 24205a8 commit ffe67c8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
synopsis: "In the debugger, `while evaluating the attribute` errors now include position information"
prs: 9915
---

Before:

```
0: while evaluating the attribute 'python311.pythonForBuild.pkgs'
0x600001522598
```

After:

```
0: while evaluating the attribute 'python311.pythonForBuild.pkgs'
/nix/store/hg65h51xnp74ikahns9hyf3py5mlbbqq-source/overrides/default.nix:132:27
131|
132| bootstrappingBase = pkgs.${self.python.pythonAttr}.pythonForBuild.pkgs;
| ^
133| in
```
2 changes: 1 addition & 1 deletion src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ void ExprSelect::eval(EvalState & state, Env & env, Value & v)
state,
*this,
env,
state.positions[pos2],
state.positions[getPos()],
"while evaluating the attribute '%1%'",
showAttrPath(state, env, attrPath))
: nullptr;
Expand Down

0 comments on commit ffe67c8

Please sign in to comment.