diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-01-31 00:11:03 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-03-15 00:44:34 -0400 |
commit | c26252af3e8a102e8ac7ab67ae3ceb2c19845cac (patch) | |
tree | c38d4da3e5d56995c40c3f15dc500976aef26a71 /lib/systems/doubles.nix | |
parent | 4c52e34ca60c58fe50e73875550068099dcdebdb (diff) |
lib, stdenv: Check `meta.platforms` against host platform and be open world
First, we need check against the host platform, not the build platform.
That's simple enough.
Second, we move away from exahustive finite case analysis (i.e.
exhaustively listing all platforms the package builds on). That only
work in a closed-world setting, where we know all platforms we might
build one. But with cross compilation, we may be building for arbitrary
platforms, So we need fancier filters. This is the closed world to open
world change.
The solution is instead of having a list of systems (strings in the form
"foo-bar"), we have a list of of systems or "patterns", i.e. attributes
that partially match the output of the parsers in `lib.systems.parse`.
The "check meta" logic treats the systems strings as an exact whitelist
just as before, but treats the patterns as a fuzzy whitelist,
intersecting the actual `hostPlatform` with the pattern and then
checking for equality. (This is done using `matchAttrs`).
The default convenience lists for `meta.platforms` are now changed to be
lists of patterns (usually a single pattern) in
`lib/systems/for-meta.nix` for maximum flexibility under this new
system.
Fixes #30902
Diffstat (limited to 'lib/systems/doubles.nix')
-rw-r--r-- | lib/systems/doubles.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 0e1ee62ac950..012a1786a3cc 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -30,14 +30,14 @@ in rec { aarch64 = filterDoubles predicates.isAarch64; x86 = filterDoubles predicates.isx86; i686 = filterDoubles predicates.isi686; - mips = filterDoubles predicates.isMips; x86_64 = filterDoubles predicates.isx86_64; + mips = filterDoubles predicates.isMips; cygwin = filterDoubles predicates.isCygwin; darwin = filterDoubles predicates.isDarwin; freebsd = filterDoubles predicates.isFreeBSD; # Should be better, but MinGW is unclear, and HURD is bit-rotted. - gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; }); + gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; }); illumos = filterDoubles predicates.isSunOS; linux = filterDoubles predicates.isLinux; netbsd = filterDoubles predicates.isNetBSD; |