nixpkgs-suyu/lib
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
..
systems lib.systems.supported: remove aarch64-darwin from Tier 3 list 2021-12-16 17:51:21 +01:00
tests
asserts.nix lib/asserts: use throw to display message for assertMsg 2022-01-19 00:50:06 +01:00
attrsets.nix Merge pull request #152392 from polykernel/attrset-optimizations-patch-1 2022-01-11 16:01:52 +00:00
cli.nix
customisation.nix
debug.nix
default.nix lib.checkListOfEnum: init 2022-01-09 19:21:08 -03:00
deprecated.nix
fetchers.nix
filesystem.nix
fixed-points.nix
flake.nix
generators.nix
kernel.nix
licenses.nix
lists.nix
meta.nix
minver.nix
modules.nix lib/modules: extract multiply-used value in byName 2021-12-28 16:53:50 +01:00
options.nix nixos/documentation: split options doc build 2022-01-02 19:46:13 +01:00
sources.nix
strings-with-deps.nix
strings.nix
trivial.nix lib.checkListOfEnum: init 2022-01-09 19:21:08 -03:00
types.nix
versions.nix
zip-int-bits.nix