-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Enter debugger on builtins.trace with an option
#9914
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
Conversation
|
Added a changelog entry. Note: If this PR is merged, #9916 should be merged as well or the behavior of |
573646a to
4440eb5
Compare
src/libexpr/eval-settings.hh
Outdated
| "The maximum function call depth to allow before erroring."}; | ||
|
|
||
| Setting<bool> builtinsTraceDebugger{this, false, "builtins-trace-debugger", | ||
| "Whether to enter the debugger on `builtins.trace` calls."}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add links to documentation of debugger and builtins.trace. People who start reading from the command reference otherwise won't know what either means or where to find that information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splitting it like this could also be a source of confusion since --debugger is not implied. perhaps it'd be better to implicitly enable the debugger when this setting is set and change the name to something that signifies such, eg --debugger-on-trace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enter debugger on `builtins.trace` with an option (cherry picked from commit 774e7ca) Change-Id: If01e2110b3a128e639b05143227e365227d149f1


Motivation
With
--debugger --debugger-on-trace,builtins.tracecalls will start the interactive debugger, exposing stack trace information.Context
Closes #1610.
I recently complained that my Nix project was emitting warnings with no clear provenance:
With this patch, it's easy to print a backtrace:
Then, we can look at the source path to see that it's a checkout of poetry2nix:
Nice!
Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.