Commit Graph

3305 Commits

Author SHA1 Message Date
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
Bernardo Meurer
6e55733359
Merge pull request #219747 from Stunkymonkey/deprecate-isNull 2023-03-16 11:10:22 -03:00
Silvan Mosberger
b611afeb74
Merge pull request #209099 from infinisil/lib.path.subpath.join
lib.path.subpath.join: init
2023-03-14 20:47:47 +01:00
sternenseemann
755c177ff9
Merge pull request #219027 from NixOS/haskell-updates
haskellPackages: update stackage and hackage; haskellPackages.ghc: 9.2.6 -> 9.2.7
2023-03-13 11:36:33 +01:00
hsjobeki
15a8d05ba5 init: lib.foldlAttrs
- provide comprehensive example
- add unit test
2023-03-11 10:42:00 +01:00
github-actions[bot]
bf7ad8aa57
Merge master into haskell-updates 2023-03-10 00:14:11 +00:00
Alyssa Ross
bc7d355dc0 lib.systems: don't try to emulate s390-linux
We don't have an emulator that can do this.
2023-03-09 19:25:23 +00:00
Robert Hensing
6b79fe8cdc
Merge pull request #211855 from hercules-ci/lib-modules-disabledModules-module-with-key
lib/modules: Allow an "anonymous" module with key in disabledModules
2023-03-09 16:16:37 +01:00
github-actions[bot]
4bda2ab514
Merge master into haskell-updates 2023-03-09 00:13:40 +00:00
sternenseemann
471b9cab41 haskell.compiler.ghcHEAD: 9.7.20221224 -> 9.7.20230217
- Christmas is over!

- Upstream has changed the name of the target triplet used for the JS
  backend from js-unknown-ghcjs to javascript-unknown-ghcjs, since Cabal
  calls the architecture "javascript":
  6636b67023

  Since the triplet is made up anyways, i.e. autoconf does not support
  it and Rust uses different triplets for its emscripten backends, we'll
  just change it as well.

- Upstream fixed the problem with ar(1) being invoked incorrectly by stage0:
  e987e345c8
2023-03-08 17:12:18 +01:00
Sandro
7f917aebcd
Merge pull request #214941 from OPNA2608/init/katawa-shoujo
katawa-shoujo: init at 1.3.1
2023-03-08 11:13:54 +01:00
pennae
61852b7faa lib: remove deprecated functions
all of these have been deprecated and raising warnings since 18.09. it's
about time we actually made good on "will be removed in the next release".
2023-03-08 03:57:38 +01:00
Atemu
19e81a9269
Merge pull request #211950 from Atemu/armv8-no-more-armv7
lib/systems/parse: stop considering armv8a able to execute armv7l
2023-03-07 19:25:32 +01:00
Felix Buehler
d10e69c86b treewide: deprecate isNull
https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull
2023-03-06 22:40:04 +01:00
Sandro
5a695ebb77
Merge pull request #210125 from OPNA2608/fix/pdisk_patchurl 2023-03-05 18:09:01 +01:00
pennae
f0e8db002b lib/options: fix mkPackageOption docs
nixdoc takes everything from Type: to Example: as the type, which
misrendered a large part of the docs. it also drops sorely needed spaces
where the type had line breaks, so all has to be on one line (or use
non-standard literal spaces, which is probably worse).

also clarify what the `?` for arguments mean while we're here.
2023-03-05 01:21:46 +01:00
Naïm Favier
a342ebe166
lib/strings: hide asciiTable
Since it's an attribute set, the lib function location generating code
tries to generate locations for each of the characters...
2023-03-04 13:20:49 +01:00
Valentin Gagarin
61cf0b2166
Merge pull request #219235 from patwid/strings-escape-query-for-url-encoding 2023-03-04 12:38:57 +01:00
Patrick Widmer
7089294f10 strings: add escapeQuery for url encoding 2023-03-03 20:48:55 +01:00
Robert Hensing
118bdf25a6 lib/modules: Allow an "anonymous" module with key in disabledModules
This makes the following work

    disabledModules = [ foo.nixosModules.bar ];

even if `bar` is not a path, but rather a module such as

    { key = "/path/to/foo#nixosModules.bar"; config = ...; }

By supporting this, the user will often be able to use the same syntax
for both importing and disabling a module. This is becoming more relevant
because flakes promote the use of attributes to reference modules. Not
all of these modules in flake attributes will be identifiable, but with
the help of a framework such as flake-parts, these attributes can be
guaranteed to be identifiable (by outPath + attribute path).
2023-03-01 15:03:44 +01:00
github-actions[bot]
399e2c78d4
Merge master into staging-next 2023-02-26 06:01:09 +00:00
Anselm Schüler
9769e90233 lib/options: Add more options to mkPackageOption 2023-02-26 03:00:22 +01:00
github-actions[bot]
4688cd53b6
Merge master into staging-next 2023-02-23 18:01:15 +00:00
Alyssa Ross
7ce8e7c4cf lib.licenses.asl20-llvm: replace llvm-exception
LLVM-exception only makes sense when used with the Apache 2.0 license,
so let's combine them, so it's not possible to forget one of them like
happened with llvm_15.
2023-02-23 17:42:15 +00:00
github-actions[bot]
390b789c39
Merge master into staging-next 2023-02-23 12:01:07 +00:00
hsjobeki
09ee6241b5 improves: comprehensiveness 2023-02-23 11:24:47 +01:00
hsjobeki
70c36dcfb8 add better documentation comments to lib.runTests 2023-02-23 10:21:58 +01:00
github-actions[bot]
fd8dd0c966
Merge master into staging-next 2023-02-21 18:01:08 +00:00
Naïm Favier
f77c364def
Merge pull request #216983 from ncfavier/showOption-comment
lib/options: update showOption comment
2023-02-21 16:31:07 +01:00
Naïm Favier
6c7d4d4f9d
lib/options: update showOption comment 2023-02-18 18:13:11 +01:00
github-actions[bot]
bf5abe92d4
Merge master into staging-next 2023-02-15 18:01:14 +00:00
Sandro
d05e6727a2
Merge pull request #203539 from SuperSandro2000/architectures-expand-inferiors
lib/systems/architectures: expand inferiors
2023-02-15 16:27:00 +01:00
Silvan Mosberger
1a2c2846b0 lib.path.subpath.join: init
This function can be used to safely join subpaths together
2023-02-13 14:01:17 +01:00
github-actions[bot]
0417b0e54f
Merge staging-next into staging 2023-02-10 00:03:00 +00:00
Domen Kožar
844a738b1f
Merge pull request #215455 from domenkozar/module-errors
nixos: Improve module conflict error messages
2023-02-10 02:42:28 +07:00
OPNA2608
235d9e2187 lib/licenses.nix: Add cc-by-nc-nd-30 2023-02-09 15:50:20 +01:00
Domen Kožar
fe734efc9c types: suggest how to resolve the conflict 2023-02-09 08:24:12 +00:00
Domen Kožar
b3cc29c288 types: explicitly state unique options are expected to be unique 2023-02-09 07:25:50 +00:00
github-actions[bot]
371c2a6303
Merge staging-next into staging 2023-02-07 18:02:15 +00:00
markuskowa
5cf138823d
Merge pull request #214930 from sheepforce/nwchem
nwchem: init at 7.0.2
2023-02-07 17:30:02 +01:00
Silvan Mosberger
a770c0393c
Merge pull request #208887 from tweag/lib.path.append
lib.path.append: init
2023-02-07 17:27:37 +01:00
Phillip Seeber
acb812207f lib/licenses: add ecl20 2023-02-07 10:39:46 +01:00
github-actions[bot]
99cce0e1f1
Merge staging-next into staging 2023-02-07 06:02:00 +00:00
Silvan Mosberger
0a60663e67
Merge pull request #206611 from h7x4/lib-lists-add-repeat
lib.lists: add `replicate`
2023-02-07 06:16:09 +01:00
github-actions[bot]
d3648def80
Merge staging-next into staging 2023-02-07 00:02:46 +00:00
Bernardo Meurer
7b7b6c248c
Merge pull request #214856 from vamega/bencode-py 2023-02-06 15:58:58 -05:00
h7x4
7c4abbf80e
lib.lists: add replicate
`replicate` returns n copies of an element as a list.

Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2023-02-06 20:40:47 +01:00
Varun Madiath
dedb550ce6 bencode-py: init at 4.0.0 2023-02-06 12:14:15 -05:00
Artturi
dcc7df7fe6
Merge pull request #211685 from Artturin/splicingstuff1-split 2023-02-03 12:49:08 +02:00
Silvan Mosberger
50e4dbf35b
Merge pull request #205557 from ncfavier/concatLines
lib/strings: add `concatLines`
2023-01-31 18:05:53 +01:00