Skip to content
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

Add builtin.breakpoint #3977

Closed

Conversation

junjihashimoto
Copy link
Member

@junjihashimoto junjihashimoto commented Aug 31, 2020

I'm trying to add a builtin.breakpoint to get it into repl everywhere.
This is the TODO of #3901.

Goal:

[nix-shell:~/git/nix]$ ./src/nix/nix repl
Welcome to Nix version 2.4. Type :? for help.

nix-repl> let a = 3; in builtins.breakpoint 2
Welcome to Nix version 2.4. Type :? for help.

nix-repl> a
3

Current result:

[nix-shell:~/git/nix]$ ./src/nix/nix repl
Welcome to Nix version 2.4. Type :? for help.

nix-repl> let a = 3; in builtins.breakpoint 2
Welcome to Nix version 2.4. Type :? for help.

nix-repl> a
error: --- UndefinedVarError ------------------------------------------------------------------------------------------------------------------------------ nix
at: (1:1) from string

     1| a
      | ^
     2| 

undefined variable 'a'

@edolstra
Copy link
Member

edolstra commented Sep 1, 2020

Could you rebase this on top of #3901? Then breakpoint can just call debuggerHook and do nothing if not running in nix repl. We don't want arbitrary Nix evaluations (e.g. nix run) starting a repl... Also, that way we don't have to put the repl in libexpr.

@junjihashimoto
Copy link
Member Author

@edolstra I will try it. Thx!

@stale
Copy link

stale bot commented Mar 5, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Mar 5, 2021
@gytis-ivaskevicius
Copy link
Contributor

This sounds awesome! Bump 👀

@stale stale bot removed the stale label Apr 29, 2021
@junjihashimoto
Copy link
Member Author

I should have to take out the attribute list of the environment created by let, then I have to add it to the staticEnv of NixRepl.
But I can't get the attribute list from EvalState.

@junjihashimoto
Copy link
Member Author

I think that when I make let, a new Env is created and linked to the previous Env, but I don't know how to access the new Env from primop.

@stale
Copy link

stale bot commented Nov 9, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Nov 9, 2021
@tomberek
Copy link
Contributor

similar: #5416

@stale stale bot removed the stale label Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants