| Commit message (Collapse) | Author | Age |
|\
| |
| | |
Introduce `lib.updateManyAttrsByPath`
|
| | |
|
| |
| |
| |
| |
| | |
builtins.groupBy is much more performant. It was introduced in
https://github.com/NixOS/nix/pull/5715
|
| | |
|
|\ \
| | |
| | | |
mips64el support
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
MIPS has a large space of {architecture,abi,endianness}; this commit
adds all of them to lib/systems/platforms.nix so we can be done with
it.
Currently lib/systems/inspect.nix has a single "isMips" predicate,
which is a bit ambiguous now that we will have both mips32 and mips64
support, with the latter having two ABIs. Let's add four new
predicates (isMips32, isMips64, isMips64n32, and isMips64n64) and
treat the now-ambiguous isMips as deprecated in favor of the
more-specific predicates. These predicates are used mainly for
enabling/disabling target-specific workarounds, and it is extremely
rare that a platform-specific workaround is needed, and both mips32
and mips64 need exactly the same workaround.
The separate predicates (isMips64n32 and isMips64n64) for ABI
distinctions are, unfortunately, useful. Boost's user-scheduled
threading (used by nix) does does not currently supports mips64n32,
which is a very desirable ABI on routers since they rarely have
more than 2**32 bytes of DRAM.
|
|\ \ \
| |/ /
|/| |
| | |
| | | |
hercules-ci/issue-146882-transparent-submodule-options
lib.modules: Let module declare options directly in bare submodule
|
| | | |
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
... where a bare submodule is an option that has a type like
`submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`.
This makes migration unnecessary when introducing a freeform type
in an existing option tree.
Closes #146882
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This ensures that the module file locations are propagated to the
freeform type, which makes it so that submodules in freeform types now
have their declaration location shown in the manual, fixing
https://github.com/NixOS/nixpkgs/issues/132085.
In addition, this also newly allows freeformTypes to be declared
multiple times and all declarations being merged together according to
normal option merging.
This also removes some awkwardness regarding the type of `freeformType`
|
|
|
|
|
|
| |
This type correctly merges multiple option types together while also
annotating them with file information. In a future commit this will be
used for `_module.freeformType`
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`builtins.currentSystem` is not available in pure eval. For this
particular test, we don't really care since it's all about generating
.drv files.
Fixes the following error:
$ nix flake check
warning: unknown flake output 'lib'
error: attribute 'currentSystem' missing
at /nix/store/8wvnlbjxlr90kq2qa6d9zjpj8rqkilr5-source/lib/tests/misc.nix:499:73:
498| let
499| deriv = derivation { name = "test"; builder = "/bin/sh"; system = builtins.currentSystem; };
| ^
500| in {
(use '--show-trace' to show detailed location informat
|
|\
| |
| | |
lib/modules: Short-circuit unmatchedDefns when configs is empty
|
| |
| |
| |
| |
| | |
Doesn't seem to have been a problem actually, but now it won't
regress.
|
| |
| |
| |
| | |
For consistency.
|
| |
| |
| |
| | |
Strengthens the tests by making sure the whole line is matched.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Makes any programming errors more likely to show up early.
Non-obvious changes because of this:
- Ignore the `evalConfig` result in `reportFailure`; we're not checking
it at that point.
- Pre-increment `$fail` and `$pass` to make sure the arithmetic doesn't
result in a zero, which would result in a non-zero exit code for the
expression.
|
| |
| |
| |
| | |
The exit codes aren't used for anything.
|
| |
| |
| |
| | |
As per <https://github.com/koalaman/shellcheck/wiki/SC2124>.
|
| | |
|
| |
| |
| |
| | |
The extra equal sign was confusing, and doesn't seem to be relevant.
|
| |
| |
| |
| |
| | |
The script uses plenty of non-POSIX features, such as referencing
`$BASH_SOURCE`.
|
| | |
|
| |
| |
| |
| |
| | |
Avoids hiding the exit code from the assignment. See
<https://github.com/koalaman/shellcheck/wiki/SC2155>.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
Allows the simultaneous construction of top-level invocations and
submodule types.
This helps structure configuration systems integration code.
|
|\
| |
| | |
lib/types: Make types.anything merge functions
|
| |
| |
| |
| |
| | |
Previously it would give an error if there were multiple function
definitions.
|
|\ \
| | |
| | | |
maintainers/maintainers-list: add Matrix IDs
|
| | | |
|
|/ /
| |
| |
| |
| | |
Given a string, this function returns a string that can be inserted
verbatim in an XML document.
|
|\ \
| |/
|/| |
lib/modules: improve errors for `options`/`config`-mixups
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As suggested in #131205.
Now it's possible to pretty-print a value with `lib.generators` like
this:
with lib.generators;
toPretty { }
(withRecursion { depthLimit = 10; } /* arbitrarily complex value */)
Also, this can be used for any other pretty-printer now if needed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When having e.g. recursive attr-set, it cannot be printed which is
solved by Nix itself like this:
$ nix-instantiate --eval -E 'let a.b = 1; a.c = a; in builtins.trace a 1'
trace: { b = 1; c = <CYCLE>; }
1
However, `generators.toPretty` tries to evaluate something until it's
done which can result in a spurious `stack-overflow`-error:
$ nix-instantiate --eval -E 'with import <nixpkgs/lib>; generators.toPretty { } (mkOption { type = types.str; })'
error: stack overflow (possible infinite recursion)
Those attr-sets are in fact rather common, one example is shown above, a
`types.<type>`-declaration is such an example. By adding an optional
`depthLimit`-argument, `toPretty` will stop evaluating as soon as the
limit is reached:
$ nix-instantiate --eval -E 'with import ./Projects/nixpkgs-update-int/lib; generators.toPretty { depthLimit = 2; } (mkOption { type = types.str; })' |xargs -0 echo -e
"{
_type = \"option\";
type = {
_type = \"option-type\";
check = <function>;
deprecationMessage = null;
description = \"string\";
emptyValue = { };
functor = {
binOp = <unevaluated>;
name = <unevaluated>;
payload = <unevaluated>;
type = <unevaluated>;
wrapped = <unevaluated>;
};
getSubModules = null;
getSubOptions = <function>;
merge = <function>;
name = \"str\";
nestedTypes = { };
substSubModules = <function>;
typeMerge = <function>;
};
}"
Optionally, it's also possible to let `toPretty` throw an error if the
limit is exceeded.
|
|/
|
|
|
|
|
|
|
|
|
| |
Tested basic functionality as:
$ nix-build --arg crossSystem '{ config = "s390x-unknown-linux-gnu"; }' -A re2c
$ file ./result/bin/re2c
$ ./result/bin/re2c: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV),
dynamically linked, interpreter ...-gnu-2.33-50/lib/ld64.so.1, for GNU/Linux 2.6.32, not stripped
$ qemu-s390x ./result/bin/re2c --version
re2c 2.2
|
|
|
|
| |
This has been synonymous for ~5y.
|
|\
| |
| | |
lib: fix functionArgs for functors
|
| |
| |
| |
| |
| |
| | |
`functionArgs` should give valid results on
functions that have been identified with `lib.isFunction`
instead of erroring out.
|
|/
|
|
|
|
|
| |
m68k was recently added for Linux and none, but NetBSD also supports
m68k. Nothing will build yet, but I want to make sure we at least
encode the existence of NetBSD support for every applicable
architecture we support for other operating systems.
|
| |
|
| |
|
| |
|
|
|
|
| |
This reverts commit 8b957e3b301d748e6fbbed806d82bd9d4b9d4ac4.
|