diff --git a/doc/manual/rl-next/debugger-positions.md b/doc/manual/rl-next/debugger-positions.md new file mode 100644 index 000000000..2fe868413 --- /dev/null +++ b/doc/manual/rl-next/debugger-positions.md @@ -0,0 +1,25 @@ +--- +synopsis: Debugger prints source position information +prs: 9913 +--- + +The `--debugger` now prints source location information, instead of the +pointers of source location information. Before: + +``` +nix-repl> :bt +0: while evaluating the attribute 'python311.pythonForBuild.pkgs' +0x600001522598 +``` + +After: + +``` +0: while evaluating the attribute 'python311.pythonForBuild.pkgs' +/nix/store/hg65h51xnp74ikahns9hyf3py5mlbbqq-source/overrides/default.nix:132:27 + + 131| + 132| bootstrappingBase = pkgs.${self.python.pythonAttr}.pythonForBuild.pkgs; + | ^ + 133| in +``` diff --git a/doc/manual/rl-next/lambda-printing.md b/doc/manual/rl-next/lambda-printing.md new file mode 100644 index 000000000..3a63f3068 --- /dev/null +++ b/doc/manual/rl-next/lambda-printing.md @@ -0,0 +1,50 @@ +--- +synopsis: Functions are printed with more detail +prs: 9606 +issues: 7145 +--- + +Functions and `builtins` are printed with more detail in `nix repl`, `nix +eval`, `builtins.trace`, and most other places values are printed. + +Before: + +``` +$ nix repl nixpkgs +nix-repl> builtins.map +«primop» + +nix-repl> builtins.map lib.id +«primop-app» + +nix-repl> builtins.trace lib.id "my-value" +trace: +"my-value" + +$ nix eval --file functions.nix +{ id = ; primop = ; primop-app = ; } +``` + +After: + +``` +$ nix repl nixpkgs +nix-repl> builtins.map +«primop map» + +nix-repl> builtins.map lib.id +«partially applied primop map» + +nix-repl> builtins.trace lib.id "my-value" +trace: «lambda id @ /nix/store/8rrzq23h2zq7sv5l2vhw44kls5w0f654-source/lib/trivial.nix:26:5» +"my-value" + +$ nix eval --file functions.nix +{ id = «lambda id @ /Users/wiggles/nix/functions.nix:2:8»; primop = «primop map»; primop-app = «partially applied primop map»; } +``` + +This was actually released in Nix 2.20, but wasn't added to the release notes +so we're announcing it here. The historical release notes have been updated as well. + +[type-error]: https://github.com/NixOS/nix/pull/9753 +[coercion-error]: https://github.com/NixOS/nix/pull/9754 diff --git a/doc/manual/rl-next/more-commands-respect-ctrl-c.md b/doc/manual/rl-next/more-commands-respect-ctrl-c.md new file mode 100644 index 000000000..948930c96 --- /dev/null +++ b/doc/manual/rl-next/more-commands-respect-ctrl-c.md @@ -0,0 +1,13 @@ +--- +synopsis: Nix commands respect Ctrl-C +prs: 9687 6995 +issues: 7245 +--- + +Previously, many Nix commands would hang indefinitely if Ctrl-C was pressed +while performing various operations (including `nix develop`, `nix flake +update`, and so on). With several fixes to Nix's signal handlers, Nix commands +will now exit quickly after Ctrl-C is pressed. + +This was actually released in Nix 2.20, but wasn't added to the release notes +so we're announcing it here. The historical release notes have been updated as well. diff --git a/doc/manual/rl-next/pretty-print-in-nix-repl.md b/doc/manual/rl-next/pretty-print-in-nix-repl.md new file mode 100644 index 000000000..26ba5162a --- /dev/null +++ b/doc/manual/rl-next/pretty-print-in-nix-repl.md @@ -0,0 +1,24 @@ +--- +synopsis: "`nix repl` pretty-prints values" +prs: 9931 +--- + +`nix repl` will now pretty-print values: + +``` +{ + attrs = { + a = { + b = { + c = { }; + }; + }; + }; + list = [ 1 ]; + list' = [ + 1 + 2 + 3 + ]; +} +``` diff --git a/doc/manual/rl-next/repl-ctrl-c-while-printing.md b/doc/manual/rl-next/repl-ctrl-c-while-printing.md new file mode 100644 index 000000000..15b0daa0a --- /dev/null +++ b/doc/manual/rl-next/repl-ctrl-c-while-printing.md @@ -0,0 +1,8 @@ +--- +synopsis: "`nix repl` now respects Ctrl-C while printing values" +prs: 9927 +--- + +`nix repl` will now halt immediately when Ctrl-C is pressed while it's printing +a value. This is useful if you got curious about what would happen if you +printed all of Nixpkgs. diff --git a/doc/manual/rl-next/repl-cycle-detection.md b/doc/manual/rl-next/repl-cycle-detection.md new file mode 100644 index 000000000..de24c4be1 --- /dev/null +++ b/doc/manual/rl-next/repl-cycle-detection.md @@ -0,0 +1,22 @@ +--- +synopsis: Cycle detection in `nix repl` is simpler and more reliable +prs: 9926 +issues: 8672 +--- + +The cycle detection in `nix repl`, `nix eval`, `builtins.trace`, and everywhere +else values are printed is now simpler and matches the cycle detection in +`nix-instantiate --eval` output. + +Before: + +``` +nix eval --expr 'let self = { inherit self; }; in self' +{ self = { self = «repeated»; }; } +``` + +After: + +``` +{ self = «repeated»; } +``` diff --git a/doc/manual/rl-next/stack-size-macos.md b/doc/manual/rl-next/stack-size-macos.md new file mode 100644 index 000000000..b1c40bb5a --- /dev/null +++ b/doc/manual/rl-next/stack-size-macos.md @@ -0,0 +1,9 @@ +--- +synopsis: Stack size is increased on macOS +prs: 9860 +--- + +Previously, Nix would set the stack size to 64MiB on Linux, but would leave the +stack size set to the default (approximately 8KiB) on macOS. Now, the stack +size is correctly set to 64MiB on macOS as well, which should reduce stack +overflow segfaults in deeply-recursive Nix expressions. diff --git a/doc/manual/src/release-notes/rl-2.20.md b/doc/manual/src/release-notes/rl-2.20.md index 26869e90a..8ede168a4 100644 --- a/doc/manual/src/release-notes/rl-2.20.md +++ b/doc/manual/src/release-notes/rl-2.20.md @@ -167,3 +167,36 @@ error: expected a set but found an integer ``` + +- Functions are printed with more detail [#7145](https://github.com/NixOS/nix/issues/7145) [#9606](https://github.com/NixOS/nix/pull/9606) + + `nix repl`, `nix eval`, `builtins.trace`, and most other places values are + printed will now include function names and source location information: + + ``` + $ nix repl nixpkgs + nix-repl> builtins.map + «primop map» + + nix-repl> builtins.map lib.id + «partially applied primop map» + + nix-repl> builtins.trace lib.id "my-value" + trace: «lambda id @ /nix/store/8rrzq23h2zq7sv5l2vhw44kls5w0f654-source/lib/trivial.nix:26:5» + "my-value" + ``` + +- Flake operations like `nix develop` will no longer fail when run in a Git + repository where the `flake.lock` file is `.gitignore`d + [#8854](https://github.com/NixOS/nix/issues/8854) + [#9324](https://github.com/NixOS/nix/pull/9324) + +- Nix commands will now respect Ctrl-C + [#7145](https://github.com/NixOS/nix/issues/7145) + [#6995](https://github.com/NixOS/nix/pull/6995) + [#9687](https://github.com/NixOS/nix/pull/9687) + + Previously, many Nix commands would hang indefinitely if Ctrl-C was pressed + while performing various operations (including `nix develop`, `nix flake + update`, and so on). With several fixes to Nix's signal handlers, Nix + commands will now exit quickly after Ctrl-C is pressed.