Allow specifying a recursionLimit for toPretty#98477
Closed
infinisil wants to merge 4 commits intoNixOS:masterfrom
Closed
Allow specifying a recursionLimit for toPretty#98477infinisil wants to merge 4 commits intoNixOS:masterfrom
recursionLimit for toPretty#98477infinisil wants to merge 4 commits intoNixOS:masterfrom
Conversation
This allows easily controlling how deep it recurses into structures
Member
Author
|
The error trace shows like this: $ nix-instantiate --eval -E 'with import ./lib; generators.toPretty {} { x.y = [ (throw "nope") ]; }' --show-trace
error: while evaluating 'go' at /home/infinisil/src/nixpkgs/lib/generators.nix:211:17, called from (string):1:20:
while evaluating anonymous function at /home/infinisil/src/nixpkgs/lib/attrsets.nix:234:10, called from undefined position:
while evaluating anonymous function at /home/infinisil/src/nixpkgs/lib/generators.nix:262:22, called from /home/infinisil/src/nixpkgs/lib/attrsets.nix:234:16:
while lib.generators.toPretty descended into the `x' attribute
while evaluating 'go' at /home/infinisil/src/nixpkgs/lib/generators.nix:211:17, called from /home/infinisil/src/nixpkgs/lib/generators.nix:264:57:
while evaluating anonymous function at /home/infinisil/src/nixpkgs/lib/attrsets.nix:234:10, called from undefined position:
while evaluating anonymous function at /home/infinisil/src/nixpkgs/lib/generators.nix:262:22, called from /home/infinisil/src/nixpkgs/lib/attrsets.nix:234:16:
while lib.generators.toPretty descended into the `y' attribute
while evaluating 'go' at /home/infinisil/src/nixpkgs/lib/generators.nix:211:17, called from /home/infinisil/src/nixpkgs/lib/generators.nix:264:57:
while evaluating anonymous function at /home/infinisil/src/nixpkgs/lib/lists.nix:106:29, called from undefined position:
while evaluating anonymous function at /home/infinisil/src/nixpkgs/lib/generators.nix:240:61, called from /home/infinisil/src/nixpkgs/lib/lists.nix:106:32:
while lib.generators.toPretty descended into list index `0'
while evaluating 'go' at /home/infinisil/src/nixpkgs/lib/generators.nix:211:17, called from /home/infinisil/src/nixpkgs/lib/generators.nix:242:14:
nope |
Member
|
I’m getting a bit worried that |
Member
|
Like, the |
Member
Author
|
Closing this for now as I have other changes relating to this |
Member
Author
|
Now #98761 adds the |
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
For being able to print infinitely-recursing values in #98155
Also,
toPrettynow adds relevant error context when recursingSee also #97133 which did other
toPrettyimprovementsPing @Profpatsch
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)