New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libexpr: add position to builtins.trace #3170
Conversation
Let the user know where the trace was produced by adding the filename and lineno from where that function was called.
Don't think this is a good idea because it changes the meaning of the trace message, possibly in a confusing way. E.g.
becomes
but that's not where
which tells you to use something in the wrong file. |
What about Ideally, there would be an optional way to print the traceback for traces, but at least this makes tracing more useful. |
Fundamentally the issue with There are two issues with the current implementation:
What if there was a new trace builtin to which the caller position could be passed? |
@edolstra what if We are importing like 10 different github repositories with Nix, and going around each and grep for usage is quite cumbersome. |
I don't know if nix can produce a readable stacktrace in the imperative sense. When the thunk gets evaluated it already lost most of its context. |
@domenkozar What do you mean with "full stack of trace"? |
Seems like I'm asking for #1610 |
Closing since a lot of improvements have been added to Nix's error reporting since then. |
Let the user know where the trace was produced by adding the filename
and lineno from where that function was called.
/cc happy birthday @domenkozar :p