git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'riscv-limitations'
commitcd7047c46169b935719ed5f19f693d97bd760ec7 authorShea Levy <shea@shealevy.com> dateTue 27 Mar 2018, 11:32 (9 years ago) parent048724c26e8d58
9 files changed+17−16
lib/meta.nix+2 lib/systems/inspect.nix−4 nixos/modules/system/boot/kexec.nix+1−1 pkgs/development/libraries/libseccomp/default.nix+1 pkgs/os-specific/linux/kexectools/default.nix+1 pkgs/os-specific/linux/systemd/default.nix+4−1 pkgs/stdenv/generic/check-meta.nix+4−2 pkgs/tools/package-management/nix/default.nix+2−2 pkgs/top-level/all-packages.nix+2−6
lib/meta.nix+2
@@ -86,4 +86,6 @@ rec {
8686 then { system = elem; }
8787 else { parsed = elem; };
8888 in lib.matchAttrs pattern platform;
89+
90+ enableIfAvailable = p: if p.meta.available or true then [ p ] else [];
8991}
lib/systems/inspect.nix−4
@@ -39,12 +39,8 @@ rec {
3939 isAndroid = [ { abi = abis.android; } { abi = abis.androideabi; } ];
4040 isMusl = with abis; map (a: { abi = a; }) [ musl musleabi musleabihf ];
4141
42− isKexecable = map (family: { kernel = kernels.linux; cpu.family = family; })
43− [ "x86" "arm" "aarch64" "mips" ];
4442 isEfi = map (family: { cpu.family = family; })
4543 [ "x86" "arm" "aarch64" ];
46− isSeccomputable = map (family: { kernel = kernels.linux; cpu.family = family; })
47− [ "x86" "arm" "aarch64" "mips" ];
4844 };
4945
5046 matchAnyAttrs = patterns:
nixos/modules/system/boot/kexec.nix+1−1
@@ -1,7 +1,7 @@
11{ config, pkgs, lib, ... }:
22
33{
4− config = lib.mkIf (pkgs.kexectools != null) {
4+ config = lib.mkIf (pkgs.kexectools.meta.available) {
55 environment.systemPackages = [ pkgs.kexectools ];
66
77 systemd.services."prepare-kexec" =
pkgs/development/libraries/libseccomp/default.nix+1
@@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
2525 homepage = "https://github.com/seccomp/libseccomp";
2626 license = licenses.lgpl21;
2727 platforms = platforms.linux;
28+ badPlatforms = platforms.riscv;
2829 maintainers = with maintainers; [ thoughtpolice wkennington ];
2930 };
3031}
pkgs/os-specific/linux/kexectools/default.nix+1
@@ -22,5 +22,6 @@ stdenv.mkDerivation rec {
2222 homepage = http://horms.net/projects/kexec/kexec-tools;
2323 description = "Tools related to the kexec Linux feature";
2424 platforms = platforms.linux;
25+ badPlatforms = platforms.riscv;
2526 };
2627}
pkgs/os-specific/linux/systemd/default.nix+4−1
@@ -41,7 +41,10 @@ in stdenv.mkDerivation rec {
4141 buildInputs =
4242 [ linuxHeaders libcap kmod xz pam acl
4343 /* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
44− libmicrohttpd kexectools libseccomp libffi audit lz4 bzip2 libapparmor
44+ libmicrohttpd ] ++
45+ stdenv.lib.meta.enableIfAvailable kexectools ++
46+ stdenv.lib.meta.enableIfAvailable libseccomp ++
47+ [ libffi audit lz4 bzip2 libapparmor
4548 iptables gnu-efi
4649 # This is actually native, but we already pull it from buildPackages
4750 pythonLxmlEnv
pkgs/stdenv/generic/check-meta.nix+4−2
@@ -165,6 +165,7 @@ let
165165 isFcitxEngine = bool;
166166 isIbusEngine = bool;
167167 isGutenprint = bool;
168+ badPlatforms = platforms;
168169 };
169170
170171 checkMetaAttr = k: v:
@@ -174,7 +175,8 @@ let
174175 checkMeta = meta: if shouldCheckMeta then lib.remove null (lib.mapAttrsToList checkMetaAttr meta) else [];
175176
176177 checkPlatform = attrs:
177− lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.platforms;
178+ (!(attrs ? meta.platforms) || lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.platforms) &&
179+ (!(attrs ? meta.badPlatforms && lib.any (lib.meta.platformMatch hostPlatform) attrs.meta.badPlatforms));
178180
179181 # Check if a derivation is valid, that is whether it passes checks for
180182 # e.g brokenness or license.
@@ -189,7 +191,7 @@ let
189191 { valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; }
190192 else if !allowBroken && attrs.meta.broken or false then
191193 { valid = false; reason = "broken"; errormsg = "is marked as broken"; }
192− else if !allowUnsupportedSystem && !allowBroken && attrs.meta.platforms or null != null && !(checkPlatform attrs) then
194+ else if !allowUnsupportedSystem && !allowBroken && !(checkPlatform attrs) then
193195 { valid = false; reason = "broken"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
194196 else if !(hasAllowedInsecure attrs) then
195197 { valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }
pkgs/tools/package-management/nix/default.nix+2−2
@@ -30,7 +30,7 @@ let
3030 buildInputs = [ curl openssl sqlite xz bzip2 ]
3131 ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
3232 ++ lib.optionals is20 [ brotli ] # Since 1.12
33− ++ lib.optional (hostPlatform.isSeccomputable) libseccomp
33+ ++ lib.meta.enableIfAvailable libseccomp
3434 ++ lib.optional ((stdenv.isLinux || stdenv.isDarwin) && is20)
3535 (aws-sdk-cpp.override {
3636 apis = ["s3"];
@@ -60,7 +60,7 @@ let
6060 hostPlatform != buildPlatform && hostPlatform ? nix && hostPlatform.nix ? system
6161 ) ''--with-system=${hostPlatform.nix.system}''
6262 # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50
63− ++ lib.optional (!hostPlatform.isSeccomputable) "--disable-seccomp-sandboxing";
63+ ++ lib.optional (!libseccomp.meta.available) "--disable-seccomp-sandboxing";
6464
6565 makeFlags = "profiledir=$(out)/etc/profile.d";
6666
pkgs/top-level/all-packages.nix+2−6
@@ -3132,9 +3132,7 @@ with pkgs;
31323132
31333133 keepalived = callPackage ../tools/networking/keepalived { };
31343134
3135− kexectools = if hostPlatform.isKexecable
3136− then callPackage ../os-specific/linux/kexectools { }
3137− else null;
3135+ kexectools = callPackage ../os-specific/linux/kexectools { };
31383136
31393137 keybase = callPackage ../tools/security/keybase { };
31403138
@@ -9795,9 +9793,7 @@ with pkgs;
97959793
97969794 libgroove = callPackage ../development/libraries/libgroove { };
97979795
9798− libseccomp = if hostPlatform.isSeccomputable
9799− then callPackage ../development/libraries/libseccomp { }
9800− else null;
9796+ libseccomp = callPackage ../development/libraries/libseccomp { };
98019797
98029798 libsecret = callPackage ../development/libraries/libsecret { };
98039799