From 392dd53f82b82cdf866de5cbeb6d2205f561b7a7 Mon Sep 17 00:00:00 2001 From: Aleksi Hannula Date: Tue, 7 Apr 2026 14:55:52 +0300 Subject: [PATCH 1/2] pkgsMusl.util-linuxMinimal: fix build --- .../ut/util-linux/fix-musl-nsenter.patch | 25 +++++++++++++++++++ pkgs/by-name/ut/util-linux/package.nix | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/by-name/ut/util-linux/fix-musl-nsenter.patch diff --git a/pkgs/by-name/ut/util-linux/fix-musl-nsenter.patch b/pkgs/by-name/ut/util-linux/fix-musl-nsenter.patch new file mode 100644 index 000000000000..73a201bd5b4c --- /dev/null +++ b/pkgs/by-name/ut/util-linux/fix-musl-nsenter.patch @@ -0,0 +1,25 @@ +From 126c850f74cbafd3af55a6f829308d7f63de4c7b Mon Sep 17 00:00:00 2001 +From: Aleksi Hannula +Date: Tue, 7 Apr 2026 14:52:16 +0300 +Subject: [PATCH] nsenter: Fix AT_HANDLE_FID on musl + +--- + sys-utils/nsenter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c +index e10ba9c..340e6b1 100644 +--- a/sys-utils/nsenter.c ++++ b/sys-utils/nsenter.c +@@ -220,7 +220,7 @@ static int fill_nsfs_file_handle(struct file_handle *fh, uint64_t ns_id) + + fh->handle_bytes = sizeof(struct nsfs_file_handle); + if (name_to_handle_at(nsfs_fd, "", fh, &mount_id, +- AT_EMPTY_PATH | AT_HANDLE_FID) == -1) ++ AT_EMPTY_PATH | 0x200 /* AT_HANDLE_FID */) == -1) + return -errno; + assert(fh->handle_type); + nsfs_fh_tmpl = *fh; +-- +2.51.2 + diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index aef6ace7f00b..6c898b45f631 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -59,6 +59,10 @@ stdenv.mkDerivation (finalAttrs: { # Fix compile of 2.42+ on Darwin. # https://lore.kernel.org/util-linux/CAEUYr6ZjVX1bd-xcBGtFN_ZYwQnXDYsw7d1-7sTpF2BbgfrR+g@mail.gmail.com/T/#u ./include-correct-struct-statfs-header.patch + + # Musl does not define AT_HANDLE_FID, hard-code it. + # https://github.com/util-linux/util-linux/pull/4203 + ./fix-musl-nsenter.patch ]; # We separate some of the utilities into their own outputs. This From 31fb6927a8a4cd23acea91f918708c5a65a593cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 8 Apr 2026 08:40:33 +0200 Subject: [PATCH 2/2] util-linux: avoid rebuild on non-musl for now --- pkgs/by-name/ut/util-linux/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index 6c898b45f631..c543091bf426 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: { # Fix compile of 2.42+ on Darwin. # https://lore.kernel.org/util-linux/CAEUYr6ZjVX1bd-xcBGtFN_ZYwQnXDYsw7d1-7sTpF2BbgfrR+g@mail.gmail.com/T/#u ./include-correct-struct-statfs-header.patch - + ] + ++ lib.optionals stdenv.hostPlatform.isMusl [ # Musl does not define AT_HANDLE_FID, hard-code it. # https://github.com/util-linux/util-linux/pull/4203 ./fix-musl-nsenter.patch