Repository navigation
Changes to make Nix output more informative errors - #612
Mathnerd314 wants to merge 3 commits into
Conversation
Mathnerd314
commented
Aug 23, 2015
- Output several more locations during --show-trace
- Option -C / --color for use with less -r
- nix-instantiate respects '-k' by continuing evaluation after errors (only with derivations)
There was a problem hiding this comment.
I guess I was a bit too focused on minimizing the diff. Fixed.
* Option -C / --color for use with less -r * nix-instantiate respects '-k' by continuing evaluation after errors (only with derivations)
|
@edolstra Is there any possibility of this being merged? |
and add lastline/lastcolumn to Pos
Also document let {}
|
Don't leave us hanging! You want to make nix output more what? 😄 |
|
@edolstra didn't read the code itself, but this is worth persuing |
|
👍 |
|
Another error that needs reasoning explanation:
It should at least say that it will evaluate nix only in search path and in Nix store. |
|
This would be so nice to have. @Mathnerd314 could you resolve merge errors and I'll test? |
|
I might update this eventually, but not anytime soon. There are some systematic design flaws which I want to resolve first. |
|
Any update on this? |
|
@alesguzik I've stopped most Nix development until June 24, 2016; you're welcome to do something with it before then though. |
|
@Mathnerd314 would love to see this going, best to open one PR per fix. That way there is a higher chance they will get merged. |
|
@Mathnerd314 could you elaborate on
so someone else can pick this up effectively? |
|
@copumpkin That's just #296 and related issues; the only issue with this PR I know of is that I'm too lazy to update it to fix the merge conflicts. From Haskell it's clear that lazy evaluation works, and so far there's been nothing urgent enough in Nix development to force me to update. But of course anyone else is welcome to pick up the code and run with it. |
|
This would be great! Has anyone looked at tackling the conflicts yet? Hopefully not too bad, but even if they are... breaking this into incremental improvements (as suggested above, and I agree should be done) means progress can be made without fixing all the things. Is this likely to have costs to eval time/size? I've always assumed |
|
Is there any life left in this? |
|
I marked this as stale due to inactivity. → More info |
|
I am sad this was neglected. I started looking to see if there was anything to salvage after our recent log overhauling. |
|
master...obsidiansystems:noisy-nix this is the first commit of this PR (without the color parts, as we have much more of that now) rebase and building but untested. That's enough for now. |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
@layus Would you be able to help me understand what parts of this haven't been obviated by changes in the last few years --- I ask you in particular because your (merged) worked landing more error context seems related. |
|
It is really difficult to say, given the codebase changed quite a lot.
* Output several more locations during --show-trace
This one seems similar to my changes, although more involved as it tracks more locations in the values.
I can have a more in-depth check if you want.
* Option -C / --color for use with less -r nix-instantiate
I do not think we have this.
* respects '-k' by continuing evaluation after errors (only with derivations)
Seems interesting, no idea if we have that.
Le 19 février 2023 19:27:44 GMT+01:00, John Ericson ***@***.***> a écrit :
…
@layus Would you be able to help me understand what parts of this haven't been obviated by changes in the last few years --- I ask you in particular because your landing more error context seems related.
--
Reply to this email directly or view it on GitHub:
#612 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
|
Thanks for taking a look, @layus! |
| } catch (Error & e) { | ||
| e.addPrefix(format("while evaluating the attribute path ‘%1%’:\n") % attrPath); | ||
| if(!settings.keepGoing) | ||
| throw; | ||
| printMsg(lvlError, format(ANSI_RED "error:" ANSI_NORMAL " " "%1%%2%") % (settings.showTrace ? e.prefix() : "") % e.msg()); | ||
| return false; |
There was a problem hiding this comment.
This is where the keepGoing stuff is, kind of a hack but it seemed to work in practice
|
|
||
| string s = (format("%1%%2%\n") % prefix % fs.s).str(); | ||
| if (!isatty(STDERR_FILENO)) s = filterANSIEscapes(s); | ||
| if (!isatty(STDERR_FILENO) && !useColor) s = filterANSIEscapes(s); |
There was a problem hiding this comment.
And this is the sole effect of the --color / -C / useColor option.
|
As far as the improved locations there were various changes:
|
|
Thanks for that summary, @Mathnerd314. |
|
Thanks @Mathnerd314, @layus, and @Ericson2314! We're on a good path away from getting overwhelmed with PRs and hopefully will slowly catch up with those stalled ones. |
|
stale: re-open and re-base as needed |
…ed-in-gc Fix crash when GC is interrupted