about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2024-04-19 08:54:46 +0200
committerVladimír Čunát <v@cunat.cz>2024-04-19 08:54:46 +0200
commit6ad1fe08582fcdfedb2cb7c31b4a016a227bd38a (patch)
tree1fe2a522831f871e217bddb24dbfeedff7798fb0 /pkgs
parentc979169d1a4b7c6513038777db6ed0c0b0c695bf (diff)
parentea1b621f86c386584487b28e6022cee340509417 (diff)
Merge #304856: coreutils: fix test failure when using musl
...into staging-next
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/misc/coreutils/default.nix5
-rw-r--r--pkgs/tools/misc/coreutils/fix-test-failure-musl.patch23
2 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index d18f2eda0e0d9..efcdce15bf028 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -39,6 +39,11 @@ stdenv.mkDerivation rec {
     hash = "sha256-zTKO3qyS9qZl3p8yPJO3Eq8YWLwuDYjz9xAEaUcKG4o=";
   };
 
+  patches = lib.optionals stdenv.hostPlatform.isMusl [
+    # https://lists.gnu.org/archive/html/bug-coreutils/2024-03/msg00089.html
+    ./fix-test-failure-musl.patch
+  ];
+
   postPatch = ''
     # The test tends to fail on btrfs, f2fs and maybe other unusual filesystems.
     sed '2i echo Skipping dd sparse test && exit 77' -i ./tests/dd/sparse.sh
diff --git a/pkgs/tools/misc/coreutils/fix-test-failure-musl.patch b/pkgs/tools/misc/coreutils/fix-test-failure-musl.patch
new file mode 100644
index 0000000000000..2d54dd27ab3fb
--- /dev/null
+++ b/pkgs/tools/misc/coreutils/fix-test-failure-musl.patch
@@ -0,0 +1,23 @@
+From 1defda6356c29c7f731bddb9e9231f594e01d9c9
+(adjusted so it can be applied on coreutils to coreutils tarball)
+
+Reported by Adept's Lab via Pádraig Brady at
+<https://lists.gnu.org/archive/html/bug-coreutils/2024-03/msg00086.html>.
+
+diff --git a/gnulib-tests/test-canonicalize.c b/gnulib-tests/test-canonicalize.c
+index 6763a525c9..5d19285c00 100644
+--- a/gnulib-tests/test-canonicalize.c
++++ b/gnulib-tests/test-canonicalize.c
+@@ -394,9 +394,9 @@ main (void)
+     ASSERT (stat ("/", &st1) == 0);
+     ASSERT (stat ("//", &st2) == 0);
+     bool same = psame_inode (&st1, &st2);
+-#if defined __MVS__ || defined MUSL_LIBC
+-    /* On IBM z/OS and musl libc, "/" and "//" both canonicalize to
+-       themselves, yet they both have st_dev == st_ino == 1.  */
++#if defined __MVS__
++    /* On IBM z/OS, "/" and "//" both canonicalize to themselves, yet they both
++       have st_dev == st_ino == 1.  */
+     same = false;
+ #endif
+     if (same)