From 582a42ece7e2a86d5b076addd5f18a6379fd326a Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 19 Apr 2022 16:32:26 +0100 Subject: [PATCH 1/3] lvm2: fix static compilation This should avoid a infinity recursion issue during static compilation, by making util-linux not a dependency of the `fix-blkdeactivate.patch`. --- pkgs/os-specific/linux/lvm2/common.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/lvm2/common.nix b/pkgs/os-specific/linux/lvm2/common.nix index 641945a5685a..53cab49f1a63 100644 --- a/pkgs/os-specific/linux/lvm2/common.nix +++ b/pkgs/os-specific/linux/lvm2/common.nix @@ -4,18 +4,19 @@ , fetchpatch , fetchurl , pkg-config -, util-linux , coreutils , libuuid , libaio , substituteAll , enableCmdlib ? false , enableDmeventd ? false -, udevSupport ? !stdenv.hostPlatform.isStatic, udev ? null +, udevSupport ? !stdenv.hostPlatform.isStatic, udev , onlyLib ? stdenv.hostPlatform.isStatic -, enableVDO ? false, vdo ? null -, enableMdadm ? false, mdadm ? null -, enableMultipath ? false, multipath-tools ? null + # Otherwise we have a infinity recursion during static compilation +, enableUtilLinux ? !stdenv.hostPlatform.isStatic, util-linux +, enableVDO ? false, vdo +, enableMdadm ? false, mdadm +, enableMultipath ? false, multipath-tools , nixosTests }: @@ -102,7 +103,7 @@ stdenv.mkDerivation rec { in { src = ./fix-blkdeactivate.patch; inherit coreutils; - util_linux = util-linux; + util_linux = optionalTool enableUtilLinux util-linux; mdadm = optionalTool enableMdadm mdadm; multipath_tools = optionalTool enableMultipath multipath-tools; vdo = optionalTool enableVDO vdo; From 67ae929deb3b3c5102848485dbb3f48e5ff27278 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 19 Apr 2022 21:46:17 +0100 Subject: [PATCH 2/3] mesa: disable withValgrind if valgrind-light is marked as broken `valgrind` derivation is currently marked as broken in either: - `stdenv.isDarwin` - `stdenv.hostPlatform.isStatic` Instead of adding those two checks in the `mesa` derivation, we can just check the current `valgrind-light.meta.broken` attribute. --- pkgs/development/libraries/mesa/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index f5dbb30d65fd..28e8c61bf736 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -9,7 +9,7 @@ , vulkanDrivers ? ["auto"] , eglPlatforms ? [ "x11" ] ++ lib.optionals stdenv.isLinux [ "wayland" ] , OpenGL, Xplugin -, withValgrind ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind-light, valgrind-light +, withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind-light && !valgrind-light.meta.broken, valgrind-light , enableGalliumNine ? stdenv.isLinux , enableOSMesa ? stdenv.isLinux , enableOpenCL ? stdenv.isLinux && stdenv.isx86_64 From c9de099fa1b00bca89183a9e3347c2629f1dcf72 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 23 Apr 2022 14:46:40 +0100 Subject: [PATCH 3/3] lvm2: move fix-blkdeactivate.patch to version 2.03.15+ only --- pkgs/os-specific/linux/lvm2/common.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/lvm2/common.nix b/pkgs/os-specific/linux/lvm2/common.nix index 53cab49f1a63..4cb86bf3d8b9 100644 --- a/pkgs/os-specific/linux/lvm2/common.nix +++ b/pkgs/os-specific/linux/lvm2/common.nix @@ -96,8 +96,9 @@ stdenv.mkDerivation rec { sed -i 's|^#define LVM_CONFIGURE_LINE.*$|#define LVM_CONFIGURE_LINE ""|g' ./include/configure.h ''; - patches = [ + patches = lib.optionals (lib.versionAtLeast version "2.03.15") [ # fixes paths to and checks for tools + # TODO: needs backport to LVM 2.02 used by static/musl (substituteAll (let optionalTool = cond: pkg: if cond then pkg else "/run/current-system/sw"; in {