From 05a6c124e65d30b5e68468c8b87f73d6b1a8c587 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 29 Mar 2022 10:27:31 +0000 Subject: [PATCH] lvm2: don't use targetPlatform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targetPlatform is the platform the current package's programs will produce binaries for — only relevant for compilers and similar. hostPlatform is the platform the current package's programs will run on. The incorrect use of targetPlatform meant that anything that tried to link to it (like cryptsetup) would fail to build when it was used as a native build input for a cross-compiled Musl derivation. Fixes: 2cc29125a72 ("lvm2: package 2.02.x for musl") --- pkgs/os-specific/linux/lvm2/common.nix | 10 +++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/os-specific/linux/lvm2/common.nix b/pkgs/os-specific/linux/lvm2/common.nix index 0f2e6efe3a2..07e8c9cb02d 100644 --- a/pkgs/os-specific/linux/lvm2/common.nix +++ b/pkgs/os-specific/linux/lvm2/common.nix @@ -9,8 +9,8 @@ , libaio , enableCmdlib ? false , enableDmeventd ? false -, udevSupport ? !stdenv.targetPlatform.isStatic, udev ? null -, onlyLib ? stdenv.targetPlatform.isStatic +, udevSupport ? !stdenv.hostPlatform.isStatic, udev ? null +, onlyLib ? stdenv.hostPlatform.isStatic , nixosTests }: @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { ] ++ lib.optionals udevSupport [ "--enable-udev_rules" "--enable-udev_sync" - ] ++ lib.optionals stdenv.targetPlatform.isStatic [ + ] ++ lib.optionals stdenv.hostPlatform.isStatic [ "--enable-static_link" ]; @@ -91,7 +91,7 @@ stdenv.mkDerivation rec { url = "https://git.alpinelinux.org/aports/plain/main/lvm2/mallinfo.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50"; sha256 = "0g6wlqi215i5s30bnbkn8w7axrs27y3bnygbpbnf64wwx7rxxlj0"; }) - ] ++ lib.optionals stdenv.targetPlatform.isStatic [ + ] ++ lib.optionals stdenv.hostPlatform.isStatic [ ./no-shared.diff ]; @@ -114,7 +114,7 @@ stdenv.mkDerivation rec { ]; installPhase = lib.optionalString onlyLib '' - install -D -t $out/lib libdm/ioctl/libdevmapper.${if stdenv.targetPlatform.isStatic then "a" else "so"} + install -D -t $out/lib libdm/ioctl/libdevmapper.${if stdenv.hostPlatform.isStatic then "a" else "so"} make -C libdm install_include make -C libdm install_pkgconfig ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db70bce5d55..97720b99172 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22984,7 +22984,7 @@ with pkgs; lvm2-2_02 = callPackage ../os-specific/linux/lvm2/2_02.nix { udev = systemdMinimal; }; - lvm2 = if stdenv.targetPlatform.isMusl then lvm2-2_02 else lvm2-2_03; + lvm2 = if stdenv.hostPlatform.isMusl then lvm2-2_02 else lvm2-2_03; lvm2_dmeventd = lvm2.override { enableDmeventd = true;