aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-06-04 11:29:48 -0400
committerGitHub <noreply@github.com>2019-06-04 11:29:48 -0400
commit760c9995b0601e8679d303ce5c301fdb33fb2c5d (patch)
tree9b6c72336df80af5becb13c3d5400102b18bac67 /lib
parent9120dbf180fd173d8aa95ca4a89ac2ab529b675c (diff)
parent635b7625690d9f8f61da0a187e7ed4a7ec274fdc (diff)
Merge pull request #60349 from matthewbauer/fix-60345
check-meta: use system tuple in platforms
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix2
-rw-r--r--lib/systems/default.nix5
-rw-r--r--lib/systems/doubles.nix3
-rw-r--r--lib/systems/for-meta.nix38
4 files changed, 7 insertions, 41 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 8735b647679..3efaaf0f8f9 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -50,7 +50,7 @@ let
filesystem = callLibs ./filesystem.nix;
# back-compat aliases
- platforms = systems.forMeta;
+ platforms = systems.doubles;
inherit (builtins) add addErrorContext attrNames concatLists
deepSeq elem elemAt filter genericClosure genList getAttr
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 5e6d277be7d..8aa413f5381 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -3,7 +3,6 @@
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; };
@@ -15,7 +14,9 @@ rec {
# `parsed` is inferred from args, both because there are two options with one
# clearly prefered, and to prevent cycles. A simpler fixed point where the RHS
# always just used `final.*` would fail on both counts.
- elaborate = args: let
+ elaborate = args': let
+ args = if lib.isString args' then { system = args'; }
+ else args';
final = {
# Prefer to parse `config` as it is strictly more informative.
parsed = parse.mkSystemFromString (if args ? config then args.config else args.system);
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix
index c6877ebef0b..ff071c182d4 100644
--- a/lib/systems/doubles.nix
+++ b/lib/systems/doubles.nix
@@ -19,6 +19,8 @@ let
"x86_64-windows" "i686-windows"
"wasm64-wasi" "wasm32-wasi"
+
+ "riscv32-linux" "riscv64-linux"
];
allParsed = map parse.mkSystemFromString all;
@@ -36,6 +38,7 @@ in rec {
i686 = filterDoubles predicates.isi686;
x86_64 = filterDoubles predicates.isx86_64;
mips = filterDoubles predicates.isMips;
+ riscv = filterDoubles predicates.isRiscV;
cygwin = filterDoubles predicates.isCygwin;
darwin = filterDoubles predicates.isDarwin;
diff --git a/lib/systems/for-meta.nix b/lib/systems/for-meta.nix
deleted file mode 100644
index 17ae94deb7d..00000000000
--- a/lib/systems/for-meta.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ lib }:
-let
- inherit (lib.systems) parse;
- inherit (lib.systems.inspect) patterns;
-
- abis = lib.mapAttrs (_: abi: builtins.removeAttrs abi [ "assertions" ]) parse.abis;
-
-in rec {
- all = [ {} ]; # `{}` matches anything
- none = [];
-
- arm = [ patterns.isAarch32 ];
- aarch64 = [ patterns.isAarch64 ];
- x86 = [ patterns.isx86 ];
- i686 = [ patterns.isi686 ];
- x86_64 = [ patterns.isx86_64 ];
- mips = [ patterns.isMips ];
- riscv = [ patterns.isRiscV ];
-
- cygwin = [ patterns.isCygwin ];
- darwin = [ patterns.isDarwin ];
- freebsd = [ patterns.isFreeBSD ];
- # Should be better, but MinGW is unclear.
- gnu = [
- { kernel = parse.kernels.linux; abi = abis.gnu; }
- { kernel = parse.kernels.linux; abi = abis.gnueabi; }
- { kernel = parse.kernels.linux; abi = abis.gnueabihf; }
- ];
- illumos = [ patterns.isSunOS ];
- linux = [ patterns.isLinux ];
- netbsd = [ patterns.isNetBSD ];
- openbsd = [ patterns.isOpenBSD ];
- unix = patterns.isUnix; # Actually a list
- windows = [ patterns.isWindows ];
- wasi = [ patterns.isWasi ];
-
- inherit (lib.systems.doubles) mesaPlatforms;
-}