nixpkgs/lib
Adam Joseph d278fd78af lib.systems.extensions.sharedLibrary: do not throw
Because downstream code expects to use `==` on platform attrsets, we
are unfortunately not able to throw a useful error message when the
`sharedLibrary` attribute is accessed.

When users do a comparison like:

  stdenv.hostPlatform == pkgsStatic.stdenv.hostPlatform

... in a situation where `stdenv.hostPlatform.hasSharedLibraries`,
they expect this to return `false`.  Unfortunately Nix does a deep
equality comparison here, and ends up forcing the
`pkgsStatic.stdenv.hostPlatform.extensions.sharedLibrary` attribute,
which throws the error.

Rather than returning `null`, this commit instead simply omits the
`extensions.sharedLibrary` attribute.  This provides the user with a
more-useful error message: instead of waiting until the `null` is
used (and hoping that produces an error), the user will get an error
about the `extensions.sharedLibrary` attribute being missing, at the
position where it was referenced.

Big thanks to @trofi for his PR to add
`NIX_VALIDATE_EVAL_NONDETERMINISM` to Nix, which I am now using.  It
made tracking this down really easy!

Fixes #244045
2023-07-04 13:39:19 -07:00
..
path lib/path/tests/prop.sh: Add --show-trace 2023-06-26 12:25:36 +02:00
systems lib.systems.extensions.sharedLibrary: do not throw 2023-07-04 13:39:19 -07:00
tests lib.mergeModules: Add context to error message 2023-07-11 13:03:52 +02:00
ascii-table.nix strings: add escapeQuery for url encoding 2023-03-03 20:48:55 +01:00
asserts.nix doc: auto-generate asserts and attrset library docs 2022-12-08 22:58:22 +01:00
attrsets.nix lib/attrsets: remove unused let bindings 2023-06-23 09:41:04 +00:00
cli.nix
customisation.nix splice.nix: finish nativeDrv,crossDrv removal 2023-06-22 23:11:08 +03:00
debug.nix lib/debug: remove unused let bindings 2023-06-23 09:41:04 +00:00
default.nix lib/options: remove literalDocBook 2023-06-13 16:56:30 +02:00
deprecated.nix lib.closePropagation: Remove the quadratic behavior in lib.closePropagation 2022-10-07 18:03:42 +02:00
derivations.nix lib.derivations: fix comment typo 2023-06-02 23:57:30 +08:00
fetchers.nix
filesystem.nix lib/filesystem: remove unused let bindings 2023-06-23 09:41:04 +00:00
fixed-points.nix doc: Render lib.fixedPoints 2023-07-08 18:46:08 +02:00
flake.nix Fix import path. 2021-08-14 14:46:00 -05:00
generators.nix lib.generators.toINIWithGlobalSection: give sections a default 2023-06-29 18:41:34 +03:00
kernel.nix lib.kernel.unset: init 2023-05-01 10:23:42 +00:00
licenses.nix Merge pull request #237895 from emilytrau/tart 2023-07-02 11:37:49 +02:00
lists.nix lib.list.findFirst: Make lazier 2023-06-06 17:17:32 +02:00
meta.nix Update lib/meta.nix 2023-01-27 11:16:29 +00:00
minver.nix boostrap fetchurl: Add SRI support 2022-08-24 09:55:45 +02:00
modules.nix lib.mergeModules: Add context to error message 2023-07-11 13:03:52 +02:00
options.nix lib: turn *MD functions into aliases 2023-06-13 16:56:32 +02:00
source-types.nix lib.sourceTypes: simplify implementation 2022-05-30 16:27:34 +08:00
sources.nix lib/sources: remove unused let bindings 2023-06-23 09:41:04 +00:00
strings-with-deps.nix
strings.nix lib: simplify stringToCharacters 2023-06-22 18:27:15 -04:00
trivial.nix lib/trivial: Bump oldestSupportedReleaseto to 23.05 2023-07-04 14:17:58 +02:00
types.nix lib/types: add pathInStore 2023-06-27 11:48:08 +02:00
versions.nix lib/versions: add pad 2022-12-21 12:58:21 +01:00
zip-int-bits.nix lib/zip-int-bits: fix typo: bitXOR -> bitXor 2022-06-09 20:04:37 +03:00