No functional changes.
- Centralize the logic classifying files/directories of interest, instead of
being spread between `directoryEntryIsPackage` and `directoryEntryToAttrPair`.
- Replace a composition of `mapAttrs'` and `filterAttrs` with `concatMapAttrs`.
- Simplify future improvements, such as creating nested scopes for subdirs,
or ignoring unsupported files.
Add a new `aarch64-freebsd` double and example system,
then fix include and libc to work.
This is enough to build packages like `hello`,
either static or dynamic.
This is useful for testing nix FreeBSD on a Raspberry Pi.
The first version that supports zstd compression, to create the option
to eventually switch compression for the binary cache.
It was released one year ago on 2023-11-03 and first shipped in NixOS
23.11.
When elaborating a system with both "config" and "system" arguments
given, they might not match the parsed results. Example:
elaborate {
config = "i686-unknown-linux-gnu";
system = "x86_64-linux";
}
This would result in a parsed system for i686, because the config
argument is preferred. But since "// args //" comes after system has
been inferred from parsed, it is overwritten again. This results in
config and parsed all pointing to i686, while system still tells the
story of x86_64.
Inconsistent arguments can also be given when passing "parsed" directly.
This happened in stage.nix for the various package sets.
The solution is simple: One of the three arguments needs to be treated
as the ultimate source of truth. "system" can already be losslessly
extracted from "parsed". However, "config" currently can not, for
example for various -mingw32 cases. Thus everything must be derived
from "config".
To do so, "system" and "parsed" arguments are made non-overrideable for
systems.elaborate. This means, that "system" will be used to parse when
"config" is not given - and "parsed" will be ignored entirely.
The systemToAttrs helper is exposed on lib.systems, because it's useful
to deal with top-level localSystem / crossSystem arguments elsewhere.
Probably a missed left over from somewhere in
the commit 58f385f680.
As can be seen in that commit where this line was introduced,
"$@" was also just emptied by the last `set` call in line 169.
This line is currently valid, but breaks suddenly when somewhere earlier
a `set --` instruction is used in the future.
Neither in commit 58f385f680
nor in PR https://github.com/NixOS/nixpkgs/pull/197547
have I found anything stating that this "defect" was intentional.