From c26252af3e8a102e8ac7ab67ae3ceb2c19845cac Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 31 Jan 2018 00:11:03 -0500 Subject: 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 --- lib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/default.nix') diff --git a/lib/default.nix b/lib/default.nix index 4c36f3b0d790..b5ccc3b51444 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -47,7 +47,7 @@ let filesystem = callLibs ./filesystem.nix; # back-compat aliases - platforms = systems.doubles; + platforms = systems.forMeta; inherit (builtins) add addErrorContext attrNames concatLists deepSeq elem elemAt filter genericClosure genList -- cgit 1.4.1