git.iko.soy/typeable/nixpkgs
on master help sign in
libseccomp: Disable only on RISC-V if Linux.

The isSeccomputable flag treated Linux without seccomp as just a normal variant, when it really should be treated as a special case incurring complexity debt to support.

commit26e8d58cb545004acb7cbd00db81a402923a2445 authorShea Levy <shea@shealevy.com> dateSun 25 Mar 2018, 17:52 (9 years ago) parentcdf9a78
5 files changed+8−9
lib/systems/inspect.nix−2 pkgs/development/libraries/libseccomp/default.nix+1 pkgs/os-specific/linux/systemd/default.nix+4−2 pkgs/tools/package-management/nix/default.nix+2−2 pkgs/top-level/all-packages.nix+1−3
lib/systems/inspect.nix−2
@@ -41,8 +41,6 @@ rec {
4141
4242 isEfi = map (family: { cpu.family = family; })
4343 [ "x86" "arm" "aarch64" ];
44− isSeccomputable = map (family: { kernel = kernels.linux; cpu.family = family; })
45− [ "x86" "arm" "aarch64" "mips" ];
4644 };
4745
4846 matchAnyAttrs = patterns:
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/systemd/default.nix+4−2
@@ -41,8 +41,10 @@ in stdenv.mkDerivation rec {
4141 buildInputs =
4242 [ linuxHeaders libcap kmod xz pam acl
4343 /* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
44− libmicrohttpd ] ++ stdenv.lib.meta.enableIfAvailable kexectools ++
45− [ 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
4648 iptables gnu-efi
4749 # This is actually native, but we already pull it from buildPackages
4850 pythonLxmlEnv
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+1−3
@@ -9792,9 +9792,7 @@ with pkgs;
97929792
97939793 libgroove = callPackage ../development/libraries/libgroove { };
97949794
9795− libseccomp = if hostPlatform.isSeccomputable
9796− then callPackage ../development/libraries/libseccomp { }
9797− else null;
9795+ libseccomp = callPackage ../development/libraries/libseccomp { };
97989796
97999797 libsecret = callPackage ../development/libraries/libsecret { };
98009798