summary refs log tree commit diff
path: root/lib/systems/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-01-31 00:11:03 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-03-15 00:44:34 -0400
commitc26252af3e8a102e8ac7ab67ae3ceb2c19845cac (patch)
treec38d4da3e5d56995c40c3f15dc500976aef26a71 /lib/systems/default.nix
parent4c52e34ca60c58fe50e73875550068099dcdebdb (diff)
downloadnixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.tar
nixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.tar.gz
nixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.tar.bz2
nixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.tar.lz
nixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.tar.xz
nixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.tar.zst
nixpkgs-c26252af3e8a102e8ac7ab67ae3ceb2c19845cac.zip
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/default.nix')
-rw-r--r--lib/systems/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index d5a206e620c..bd408e00bb1 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -3,6 +3,7 @@
 
 rec {
   doubles = import ./doubles.nix { inherit lib; };
+  forMeta = import ./for-meta.nix { inherit lib; };
   parse = import ./parse.nix { inherit lib; };
   inspect = import ./inspect.nix { inherit lib; };
   platforms = import ./platforms.nix { inherit lib; };