From 754ea9058daebaaa85e7c6e683a54b948b96bdec Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 3 Jun 2024 18:06:42 +0200 Subject: [PATCH] release notes: 2.23.0 --- doc/manual/rl-next/builtins-warn.md | 10 -- doc/manual/rl-next/consistent-nix-build.md | 6 -- doc/manual/rl-next/derivation-json-change.md | 12 --- .../rl-next/fix-silent-unknown-options.md | 28 ----- doc/manual/rl-next/nix-env-shell.md | 12 --- .../print-value-in-installable-flake-error.md | 18 ---- .../shallow-git-fetching-by-default.md | 12 --- doc/manual/rl-next/store-object-info.md | 11 -- doc/manual/rl-next/warn-large-path.md | 11 -- doc/manual/src/SUMMARY.md.in | 1 + doc/manual/src/release-notes/rl-2.23.md | 102 ++++++++++++++++++ 11 files changed, 103 insertions(+), 120 deletions(-) delete mode 100644 doc/manual/rl-next/builtins-warn.md delete mode 100644 doc/manual/rl-next/consistent-nix-build.md delete mode 100644 doc/manual/rl-next/derivation-json-change.md delete mode 100644 doc/manual/rl-next/fix-silent-unknown-options.md delete mode 100644 doc/manual/rl-next/nix-env-shell.md delete mode 100644 doc/manual/rl-next/print-value-in-installable-flake-error.md delete mode 100644 doc/manual/rl-next/shallow-git-fetching-by-default.md delete mode 100644 doc/manual/rl-next/store-object-info.md delete mode 100644 doc/manual/rl-next/warn-large-path.md create mode 100644 doc/manual/src/release-notes/rl-2.23.md diff --git a/doc/manual/rl-next/builtins-warn.md b/doc/manual/rl-next/builtins-warn.md deleted file mode 100644 index f805e1610..000000000 --- a/doc/manual/rl-next/builtins-warn.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -synopsis: "New builtin: `builtins.warn`" -issues: 306026 -prs: 10592 ---- - -`builtins.warn` behaves like `builtins.trace "warning: ${msg}"`, has an accurate log level, and is controlled by the options -[`debugger-on-trace`](@docroot@/command-ref/conf-file.md#conf-debugger-on-trace), -[`debugger-on-warn`](@docroot@/command-ref/conf-file.md#conf-debugger-on-warn) and -[`abort-on-warn`](@docroot@/command-ref/conf-file.md#conf-abort-on-warn). diff --git a/doc/manual/rl-next/consistent-nix-build.md b/doc/manual/rl-next/consistent-nix-build.md deleted file mode 100644 index d5929dc8e..000000000 --- a/doc/manual/rl-next/consistent-nix-build.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -synopsis: Show all FOD errors with `nix build --keep-going` ---- - -`nix build --keep-going` now behaves consistently with `nix-build --keep-going`. This means -that if e.g. multiple FODs fail to build, all hash mismatches are displayed. diff --git a/doc/manual/rl-next/derivation-json-change.md b/doc/manual/rl-next/derivation-json-change.md deleted file mode 100644 index 2a1d40e83..000000000 --- a/doc/manual/rl-next/derivation-json-change.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -synopsis: Modify `nix derivation {add,show}` JSON format -issues: 9866 -prs: 10722 ---- - -The JSON format for derivations has been slightly revised to better conform to our [JSON guidelines](@docroot@contributing/cli-guideline#returning-future-proof-json). -In particular, the hash algorithm and content addressing method of content-addresed derivation outputs is now separated into two fields `hashAlgo` and `method`, -rather than one field with an arcane `:`-separated format. - -This JSON format is only used by the experimental `nix derivation` family of commands, at this time. -Future revisions are expected as the JSON format is still not entirely in compliance even after these changes. diff --git a/doc/manual/rl-next/fix-silent-unknown-options.md b/doc/manual/rl-next/fix-silent-unknown-options.md deleted file mode 100644 index 0977260ac..000000000 --- a/doc/manual/rl-next/fix-silent-unknown-options.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -synopsis: Warn on unknown settings anywhere in the command line -prs: 10701 ---- - -All `nix` commands will now properly warn when an unknown option is specified anywhere in the command line. - -Before: - -```console -$ nix-instantiate --option foobar baz --expr '{}' -warning: unknown setting 'foobar' -$ nix-instantiate '{}' --option foobar baz --expr -$ nix eval --expr '{}' --option foobar baz -{ } -``` - -After: - -```console -$ nix-instantiate --option foobar baz --expr '{}' -warning: unknown setting 'foobar' -$ nix-instantiate '{}' --option foobar baz --expr -warning: unknown setting 'foobar' -$ nix eval --expr '{}' --option foobar baz -warning: unknown setting 'foobar' -{ } -``` diff --git a/doc/manual/rl-next/nix-env-shell.md b/doc/manual/rl-next/nix-env-shell.md deleted file mode 100644 index b2344417a..000000000 --- a/doc/manual/rl-next/nix-env-shell.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -synopsis: "`nix env shell` is the new `nix shell`, and `nix shell` remains an accepted alias" -issues: 10504 -prs: 10807 ---- - -This is part of an effort to bring more structure to the CLI subcommands. - -`nix env` will be about the process environment. -Future commands may include `nix env run` and `nix env print-env`. - -It is also somewhat analogous to the [planned](https://github.com/NixOS/nix/issues/10504) `nix dev shell` (currently `nix develop`), which is less about environment variables, and more about running a development shell, which is a more powerful command, but also requires more setup. diff --git a/doc/manual/rl-next/print-value-in-installable-flake-error.md b/doc/manual/rl-next/print-value-in-installable-flake-error.md deleted file mode 100644 index bb35e252e..000000000 --- a/doc/manual/rl-next/print-value-in-installable-flake-error.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -synopsis: New-cli flake commands that expect derivations now print the failing value and its type -prs: 10778 ---- - -In errors like `flake output attribute 'nixosConfigurations.yuki.config' is not a derivation or path`, the message now includes the failing value and type. - -Before: - -``` - error: flake output attribute 'nixosConfigurations.yuki.config' is not a derivation or path -```` - -After: - -``` - error: expected flake output attribute 'nixosConfigurations.yuki.config' to be a derivation or path but found a set: { appstream = «thunk»; assertions = «thunk»; boot = { bcache = «thunk»; binfmt = «thunk»; binfmtMiscRegistrations = «thunk»; blacklistedKernelModules = «thunk»; bootMount = «thunk»; bootspec = «thunk»; cleanTmpDir = «thunk»; consoleLogLevel = «thunk»; «43 attributes elided» }; «48 attributes elided» } -``` diff --git a/doc/manual/rl-next/shallow-git-fetching-by-default.md b/doc/manual/rl-next/shallow-git-fetching-by-default.md deleted file mode 100644 index 4d044f881..000000000 --- a/doc/manual/rl-next/shallow-git-fetching-by-default.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -synopsis: "`fetchTree` now fetches git repositories shallowly by default" -prs: 10028 ---- - -`builtins.fetchTree` now clones git repositories shallowly by default, which reduces network traffic and disk usage significantly in many cases. - -Previously, the default behavior was to clone the full history of a specific tag or branch (eg. `ref`) and only afterwards extract the files of one specific revision. - -From now on, the `ref` and `allRefs` arguments will be ignored, except if shallow cloning is disabled by setting `shallow = false`. - -The defaults for `builtins.fetchGit` remain unchanged. Here, shallow cloning has to be enabled manually by passing `shallow = true`. diff --git a/doc/manual/rl-next/store-object-info.md b/doc/manual/rl-next/store-object-info.md deleted file mode 100644 index ab8f5fec0..000000000 --- a/doc/manual/rl-next/store-object-info.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -synopsis: Store object info JSON format now uses `null` rather than omitting fields. -prs: 9995 ---- - -The [store object info JSON format](@docroot@/protocols/json/store-object-info.md), used for e.g. `nix path-info`, no longer omits fields to indicate absent information, but instead includes the fields with a `null` value. -For example, `"ca": null` is used to to indicate a store object that isn't content-addressed rather than omitting the `ca` field entirely. -This makes records of this sort more self-describing, and easier to consume programmatically. - -We will follow this design principle going forward; -the [JSON guidelines](@docroot@/contributing/json-guideline.md) in the contributing section have been updated accordingly. diff --git a/doc/manual/rl-next/warn-large-path.md b/doc/manual/rl-next/warn-large-path.md deleted file mode 100644 index 5ee3e307f..000000000 --- a/doc/manual/rl-next/warn-large-path.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -synopsis: Large path warnings -prs: 10661 ---- - -Nix can now warn when evaluation of a Nix expression causes a large -path to be copied to the Nix store. The threshold for this warning can -be configured using [the `warn-large-path-threshold` -setting](@docroot@/command-ref/conf-file.md#warn-large-path-threshold), -e.g. `--warn-large-path-threshold 100M` will warn about paths larger -than 100 MiB. diff --git a/doc/manual/src/SUMMARY.md.in b/doc/manual/src/SUMMARY.md.in index 18e7e8380..cb54a3822 100644 --- a/doc/manual/src/SUMMARY.md.in +++ b/doc/manual/src/SUMMARY.md.in @@ -125,6 +125,7 @@ - [C++ style guide](contributing/cxx.md) - [Releases](release-notes/index.md) {{#include ./SUMMARY-rl-next.md}} + - [Release 2.23 (2024-06-03)](release-notes/rl-2.23.md) - [Release 2.22 (2024-04-23)](release-notes/rl-2.22.md) - [Release 2.21 (2024-03-11)](release-notes/rl-2.21.md) - [Release 2.20 (2024-01-29)](release-notes/rl-2.20.md) diff --git a/doc/manual/src/release-notes/rl-2.23.md b/doc/manual/src/release-notes/rl-2.23.md new file mode 100644 index 000000000..c08782122 --- /dev/null +++ b/doc/manual/src/release-notes/rl-2.23.md @@ -0,0 +1,102 @@ +# Release 2.23.0 (2024-06-03) + +- New builtin: `builtins.warn` [#306026](https://github.com/NixOS/nix/issues/306026) [#10592](https://github.com/NixOS/nix/pull/10592) + + `builtins.warn` behaves like `builtins.trace "warning: ${msg}"`, has an accurate log level, and is controlled by the options + [`debugger-on-trace`](@docroot@/command-ref/conf-file.md#conf-debugger-on-trace), + [`debugger-on-warn`](@docroot@/command-ref/conf-file.md#conf-debugger-on-warn) and + [`abort-on-warn`](@docroot@/command-ref/conf-file.md#conf-abort-on-warn). + +- Show all FOD errors with `nix build --keep-going` + + `nix build --keep-going` now behaves consistently with `nix-build --keep-going`. This means + that if e.g. multiple FODs fail to build, all hash mismatches are displayed. + +- Modify `nix derivation {add,show}` JSON format [#9866](https://github.com/NixOS/nix/issues/9866) [#10722](https://github.com/NixOS/nix/pull/10722) + + The JSON format for derivations has been slightly revised to better conform to our [JSON guidelines](@docroot@contributing/cli-guideline#returning-future-proof-json). + In particular, the hash algorithm and content addressing method of content-addresed derivation outputs is now separated into two fields `hashAlgo` and `method`, + rather than one field with an arcane `:`-separated format. + + This JSON format is only used by the experimental `nix derivation` family of commands, at this time. + Future revisions are expected as the JSON format is still not entirely in compliance even after these changes. + +- Warn on unknown settings anywhere in the command line [#10701](https://github.com/NixOS/nix/pull/10701) + + All `nix` commands will now properly warn when an unknown option is specified anywhere in the command line. + + Before: + + ```console + $ nix-instantiate --option foobar baz --expr '{}' + warning: unknown setting 'foobar' + $ nix-instantiate '{}' --option foobar baz --expr + $ nix eval --expr '{}' --option foobar baz + { } + ``` + + After: + + ```console + $ nix-instantiate --option foobar baz --expr '{}' + warning: unknown setting 'foobar' + $ nix-instantiate '{}' --option foobar baz --expr + warning: unknown setting 'foobar' + $ nix eval --expr '{}' --option foobar baz + warning: unknown setting 'foobar' + { } + ``` + +- `nix env shell` is the new `nix shell`, and `nix shell` remains an accepted alias [#10504](https://github.com/NixOS/nix/issues/10504) [#10807](https://github.com/NixOS/nix/pull/10807) + + This is part of an effort to bring more structure to the CLI subcommands. + + `nix env` will be about the process environment. + Future commands may include `nix env run` and `nix env print-env`. + + It is also somewhat analogous to the [planned](https://github.com/NixOS/nix/issues/10504) `nix dev shell` (currently `nix develop`), which is less about environment variables, and more about running a development shell, which is a more powerful command, but also requires more setup. + +- New-cli flake commands that expect derivations now print the failing value and its type [#10778](https://github.com/NixOS/nix/pull/10778) + + In errors like `flake output attribute 'nixosConfigurations.yuki.config' is not a derivation or path`, the message now includes the failing value and type. + + Before: + + ``` + error: flake output attribute 'nixosConfigurations.yuki.config' is not a derivation or path + ```` + + After: + + ``` + error: expected flake output attribute 'nixosConfigurations.yuki.config' to be a derivation or path but found a set: { appstream = «thunk»; assertions = «thunk»; boot = { bcache = «thunk»; binfmt = «thunk»; binfmtMiscRegistrations = «thunk»; blacklistedKernelModules = «thunk»; bootMount = «thunk»; bootspec = «thunk»; cleanTmpDir = «thunk»; consoleLogLevel = «thunk»; «43 attributes elided» }; «48 attributes elided» } + ``` + +- `fetchTree` now fetches git repositories shallowly by default [#10028](https://github.com/NixOS/nix/pull/10028) + + `builtins.fetchTree` now clones git repositories shallowly by default, which reduces network traffic and disk usage significantly in many cases. + + Previously, the default behavior was to clone the full history of a specific tag or branch (eg. `ref`) and only afterwards extract the files of one specific revision. + + From now on, the `ref` and `allRefs` arguments will be ignored, except if shallow cloning is disabled by setting `shallow = false`. + + The defaults for `builtins.fetchGit` remain unchanged. Here, shallow cloning has to be enabled manually by passing `shallow = true`. + +- Store object info JSON format now uses `null` rather than omitting fields. [#9995](https://github.com/NixOS/nix/pull/9995) + + The [store object info JSON format](@docroot@/protocols/json/store-object-info.md), used for e.g. `nix path-info`, no longer omits fields to indicate absent information, but instead includes the fields with a `null` value. + For example, `"ca": null` is used to to indicate a store object that isn't content-addressed rather than omitting the `ca` field entirely. + This makes records of this sort more self-describing, and easier to consume programmatically. + + We will follow this design principle going forward; + the [JSON guidelines](@docroot@/contributing/json-guideline.md) in the contributing section have been updated accordingly. + +- Large path warnings [#10661](https://github.com/NixOS/nix/pull/10661) + + Nix can now warn when evaluation of a Nix expression causes a large + path to be copied to the Nix store. The threshold for this warning can + be configured using [the `warn-large-path-threshold` + setting](@docroot@/command-ref/conf-file.md#warn-large-path-threshold), + e.g. `--warn-large-path-threshold 100M` will warn about paths larger + than 100 MiB. +