nixpkgs-suyu/lib
Cole Helbling d9f767600f lib/customisation: callPackageWith should abort with errors
ofborg relies on the behavior that existed prior to
1c00bf3948, where evaluation would
immediately abort due to a missing argument (whether it be an aliased
package when `allowAliases = false;` or a typo'd or otherwise
nonexistent package).

If `callPackageWith` `throw`s instead of `abort`s, the following
`nix-env` invocation does not fail fast but instead silently skips the
attribute (assuming there is a package that has an aliased package in
its `autoArgs`):

    $ nix-env -qa --json --file . --arg config '{ allowAliases = false; }' &>/dev/null
    $ echo $?
    0

This does change the error output when there is a missing package (for
any of the reasons mentioned above), though. Before this change, the
errors looked like this:

    $ nix-build -A hello --arg config '{ allowAliases = false; }'
    error:
           … while calling the 'throw' builtin

             at /home/vin/workspace/vcs/nixpkgs/master/lib/customisation.nix:179:65:

              178|
              179|     in if missingArgs == [] then makeOverridable f allArgs else throw error;
                 |                                                                 ^
              180|

           error: Function called without required argument "bash_5" at /home/vin/workspace/vcs/nixpkgs/master/pkgs/applications/misc/hello/default.nix:8, did you mean "bash" or "bashdb"?

And the errors now look like this:

    $ nix-build -A hello --arg config '{ allowAliases = false; }'
    error:
           … while calling the 'abort' builtin

             at /home/vin/workspace/vcs/nixpkgs/master/lib/customisation.nix:179:65:

              178|
              179|     in if missingArgs == [] then makeOverridable f allArgs else abort error;
                 |                                                                 ^
              180|

           error: evaluation aborted with the following error message: 'Function called without required argument "bash_5" at /home/vin/workspace/vcs/nixpkgs/master/pkgs/applications/misc/hello/default.nix:8, did you mean "bash" or "bashdb"?'
2023-03-24 14:22:11 -07:00
..
path lib.path.subpath.join: init 2023-02-13 14:01:17 +01:00
systems Merge master into haskell-updates 2023-03-10 00:14:11 +00:00
tests init: lib.foldlAttrs 2023-03-11 10:42:00 +01:00
ascii-table.nix strings: add escapeQuery for url encoding 2023-03-03 20:48:55 +01:00
asserts.nix
attrsets.nix init: lib.foldlAttrs 2023-03-11 10:42:00 +01:00
cli.nix
customisation.nix lib/customisation: callPackageWith should abort with errors 2023-03-24 14:22:11 -07:00
debug.nix lib: remove deprecated functions 2023-03-08 03:57:38 +01:00
default.nix init: lib.foldlAttrs 2023-03-11 10:42:00 +01:00
deprecated.nix
derivations.nix
fetchers.nix
filesystem.nix
fixed-points.nix lib: make extender available on self-references 2023-01-15 11:34:05 -08:00
flake.nix
generators.nix treewide: deprecate isNull 2023-03-06 22:40:04 +01:00
kernel.nix
licenses.nix Merge pull request #214941 from OPNA2608/init/katawa-shoujo 2023-03-08 11:13:54 +01:00
lists.nix Merge pull request #206611 from h7x4/lib-lists-add-repeat 2023-02-07 06:16:09 +01:00
meta.nix Update lib/meta.nix 2023-01-27 11:16:29 +00:00
minver.nix
modules.nix lib/modules: Allow an "anonymous" module with key in disabledModules 2023-03-01 15:03:44 +01:00
options.nix lib/options: fix mkPackageOption docs 2023-03-05 01:21:46 +01:00
source-types.nix
sources.nix
strings-with-deps.nix
strings.nix lib/strings: hide asciiTable 2023-03-04 13:20:49 +01:00
trivial.nix lib/trival: Bump oldestSupportedRelease to 2211 2023-01-01 14:57:25 +01:00
types.nix lib.strings: isSimpleCoercibleString -> isStringLike 2022-12-31 01:33:46 +01:00
versions.nix lib/versions: add pad 2022-12-21 12:58:21 +01:00
zip-int-bits.nix