1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/nixos/doc/manual/release-notes
sternenseemann 48965506a1 lib/asserts: use throw to display message for assertMsg
`assert` has the annoying property that it dumps a lot of code at the
user without the built in capability to display a nicer message. We have
worked around this using `assertMsg` which would *additionally* display
a nice message. We can do even better: By using `throw` we can make
evaluation fail before assert draws its conclusions and prevent it from
displaying the code making up the assert condition, so we get the nicer
message of `throw` and the syntactical convenience of `assert`.

Before:

    nix-repl> python.override { reproducibleBuild = true; stripBytecode = false; }
    trace: Deterministic builds require stripping bytecode.
    error: assertion (((lib).assertMsg  (reproducibleBuild -> stripBytecode))  "Deterministic builds require stripping bytecode.") failed at /home/lukas/src/nix/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix:45:1

After:

    nix-repl> python.override { reproducibleBuild = true; stripBytecode = false; }
    error: Deterministic builds require stripping bytecode.
2022-01-19 00:50:06 +01:00
..
release-notes.xml docs: nixos release notes to CommonMark (2105) 2021-06-23 12:33:16 -05:00
rl-1310.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1404.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1412.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1509.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1603.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1609.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1703.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1709.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1803.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1809.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1903.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-1909.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-2003.section.md docs: nixos release notes (w/o 2105 - separate PR) 2021-06-22 09:52:13 -05:00
rl-2009.section.md nixos/doc: fix merged items in 20.09 rel notes 2021-09-11 08:16:31 +00:00
rl-2105.section.md nixos: fix release notes about linux_latest version 2021-08-16 19:32:04 +02:00
rl-2111.section.md linux: enable BPF_UNPRIV_DEFAULT_OFF between 5.10 and 5.15 2022-01-15 23:44:19 +01:00
rl-2205.section.md lib/asserts: use throw to display message for assertMsg 2022-01-19 00:50:06 +01:00