From 754c35abfbed653492859136cd41a80b38009e27 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:33:05 -0800 Subject: [PATCH 01/10] Add release notes for "Debugger prints source position information" --- doc/manual/rl-next/debugger-positions.md | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 doc/manual/rl-next/debugger-positions.md 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 +``` From 9a5d52262fd83ab11cb36ba2ba91ea27b2389670 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:33:31 -0800 Subject: [PATCH 02/10] Add release notes for "Nix no longer attempts to `git add` files that are `.gitignore`d" --- doc/manual/src/release-notes/rl-2.20.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/manual/src/release-notes/rl-2.20.md b/doc/manual/src/release-notes/rl-2.20.md index 26869e90a..5152926e7 100644 --- a/doc/manual/src/release-notes/rl-2.20.md +++ b/doc/manual/src/release-notes/rl-2.20.md @@ -167,3 +167,7 @@ error: expected a set but found an integer ``` +- 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) From abb5fef355afc14819c96de08a3687c2257bd10c Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:33:58 -0800 Subject: [PATCH 03/10] Add release notes for "Functions are printed with more detail" --- doc/manual/rl-next/lambda-printing.md | 50 +++++++++++++++++++++++++ doc/manual/src/release-notes/rl-2.20.md | 19 ++++++++++ 2 files changed, 69 insertions(+) create mode 100644 doc/manual/rl-next/lambda-printing.md 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/src/release-notes/rl-2.20.md b/doc/manual/src/release-notes/rl-2.20.md index 5152926e7..666d0b4db 100644 --- a/doc/manual/src/release-notes/rl-2.20.md +++ b/doc/manual/src/release-notes/rl-2.20.md @@ -167,6 +167,25 @@ 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) From 24cdb81bb043a156346dd9e235e66889567c5fdc Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:34:14 -0800 Subject: [PATCH 04/10] Add release notes for "Nix commands respect Ctrl-C" --- doc/manual/rl-next/more-commands-respect-ctrl-c.md | 13 +++++++++++++ doc/manual/src/release-notes/rl-2.20.md | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 doc/manual/rl-next/more-commands-respect-ctrl-c.md 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/src/release-notes/rl-2.20.md b/doc/manual/src/release-notes/rl-2.20.md index 666d0b4db..8ede168a4 100644 --- a/doc/manual/src/release-notes/rl-2.20.md +++ b/doc/manual/src/release-notes/rl-2.20.md @@ -190,3 +190,13 @@ 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. From 4f0d43a397205c185eea81e553e30fefc2c0d9f5 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:34:28 -0800 Subject: [PATCH 05/10] Add release notes for "`nix repl` now respects Ctrl-C while printing values" --- doc/manual/rl-next/repl-ctrl-c-while-printing.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/manual/rl-next/repl-ctrl-c-while-printing.md 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. From 837c350bcd36f51d656fdb3bf1c40bce398181b0 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:34:46 -0800 Subject: [PATCH 06/10] Add release notes for "Cycle detection in `nix repl` is simpler and more reliable" --- doc/manual/rl-next/repl-cycle-detection.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/manual/rl-next/repl-cycle-detection.md 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»; } +``` From 7f8960d0f29991d6df8320059378d67530b45c50 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:35:06 -0800 Subject: [PATCH 07/10] Add release notes for "Stack size is increased on macOS" --- doc/manual/rl-next/stack-size-macos.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/manual/rl-next/stack-size-macos.md 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. From b2868acbdc125bf3638f21dd8c5684cc56d4b739 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Mon, 5 Feb 2024 12:35:21 -0800 Subject: [PATCH 08/10] Add release notes for "Stack traces are more compact" --- .../rl-next/stack-traces-are-more-compact.md | 51 +++++++++++++++++++ doc/manual/src/release-notes/rl-2.20.md | 19 +++++++ 2 files changed, 70 insertions(+) create mode 100644 doc/manual/rl-next/stack-traces-are-more-compact.md diff --git a/doc/manual/rl-next/stack-traces-are-more-compact.md b/doc/manual/rl-next/stack-traces-are-more-compact.md new file mode 100644 index 000000000..751465da1 --- /dev/null +++ b/doc/manual/rl-next/stack-traces-are-more-compact.md @@ -0,0 +1,51 @@ +--- +synopsis: Stack traces are more compact +prs: 9619 +--- + +Stack traces printed with `--show-trace` are more compact. + +Before: + +``` +error: + … while evaluating the attribute 'body' + + at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:4:3: + + 3| + 4| body = x "x"; + | ^ + 5| } + + error: assertion '(arg == "y")' failed + + at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:2:12: + + 1| let { + 2| x = arg: assert arg == "y"; 123; + | ^ + 3| +``` + +After: + +``` +error: + … while evaluating the attribute 'body' + at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:4:3: + 3| + 4| body = x "x"; + | ^ + 5| } + + error: assertion '(arg == "y")' failed + at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:2:12: + 1| let { + 2| x = arg: assert arg == "y"; 123; + | ^ + 3| +``` + +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/src/release-notes/rl-2.20.md b/doc/manual/src/release-notes/rl-2.20.md index 8ede168a4..4dd49c5ea 100644 --- a/doc/manual/src/release-notes/rl-2.20.md +++ b/doc/manual/src/release-notes/rl-2.20.md @@ -200,3 +200,22 @@ 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. + +- Blank lines have been removed from stack traces, rendering them more compact [#9619](https://github.com/NixOS/nix/pull/9619) + + ``` + error: + … while evaluating the attribute 'body' + at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:4:3: + 3| + 4| body = x "x"; + | ^ + 5| } + + error: assertion '(arg == "y")' failed + at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:2:12: + 1| let { + 2| x = arg: assert arg == "y"; 123; + | ^ + 3| + ``` From 0f1269243b242be033ff031ab1993e05cf25d857 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 8 Feb 2024 10:09:47 -0800 Subject: [PATCH 09/10] Revert "Add release notes for "Stack traces are more compact"" This reverts commit b2868acbdc125bf3638f21dd8c5684cc56d4b739. --- .../rl-next/stack-traces-are-more-compact.md | 51 ------------------- doc/manual/src/release-notes/rl-2.20.md | 19 ------- 2 files changed, 70 deletions(-) delete mode 100644 doc/manual/rl-next/stack-traces-are-more-compact.md diff --git a/doc/manual/rl-next/stack-traces-are-more-compact.md b/doc/manual/rl-next/stack-traces-are-more-compact.md deleted file mode 100644 index 751465da1..000000000 --- a/doc/manual/rl-next/stack-traces-are-more-compact.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -synopsis: Stack traces are more compact -prs: 9619 ---- - -Stack traces printed with `--show-trace` are more compact. - -Before: - -``` -error: - … while evaluating the attribute 'body' - - at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:4:3: - - 3| - 4| body = x "x"; - | ^ - 5| } - - error: assertion '(arg == "y")' failed - - at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:2:12: - - 1| let { - 2| x = arg: assert arg == "y"; 123; - | ^ - 3| -``` - -After: - -``` -error: - … while evaluating the attribute 'body' - at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:4:3: - 3| - 4| body = x "x"; - | ^ - 5| } - - error: assertion '(arg == "y")' failed - at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:2:12: - 1| let { - 2| x = arg: assert arg == "y"; 123; - | ^ - 3| -``` - -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/src/release-notes/rl-2.20.md b/doc/manual/src/release-notes/rl-2.20.md index 4dd49c5ea..8ede168a4 100644 --- a/doc/manual/src/release-notes/rl-2.20.md +++ b/doc/manual/src/release-notes/rl-2.20.md @@ -200,22 +200,3 @@ 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. - -- Blank lines have been removed from stack traces, rendering them more compact [#9619](https://github.com/NixOS/nix/pull/9619) - - ``` - error: - … while evaluating the attribute 'body' - at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:4:3: - 3| - 4| body = x "x"; - | ^ - 5| } - - error: assertion '(arg == "y")' failed - at /Users/wiggles/nix/tests/functional/lang/eval-fail-assert.nix:2:12: - 1| let { - 2| x = arg: assert arg == "y"; 123; - | ^ - 3| - ``` From 6d2b446e2b71d288f0f9e02270c948f66516f33e Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Wed, 14 Feb 2024 08:49:47 -0800 Subject: [PATCH 10/10] Add release notes for "Pretty print values in `nix repl`" --- .../rl-next/pretty-print-in-nix-repl.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doc/manual/rl-next/pretty-print-in-nix-repl.md 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 + ]; +} +```