From 597f83798dd95205862b31e27db54684d6026617 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 3 Jul 2023 17:09:20 -0400 Subject: [PATCH] diffutils: disable hanging test on x86_64-darwin The test-c-stack tests hang on x86_64-darwin when they are run under Rosetta 2. Disabling these tests allows the rest of the tests to run successfully on that platform. This is a similar to the issue that affected gnugrep (NixOS#236229). --- pkgs/tools/text/diffutils/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index 7b2660a71149..040f363fa55d 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -20,6 +20,13 @@ stdenv.mkDerivation rec { /* If no explicit coreutils is given, use the one from stdenv. */ buildInputs = [ coreutils ]; + # Disable stack-related gnulib tests on x86_64-darwin because they have problems running under + # Rosetta 2: test-c-stack hangs, test-sigsegv-catch-stackoverflow fails. + postPatch = if (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) then '' + sed -i -E 's:test-c-stack2?\.sh::g' gnulib-tests/Makefile.in + sed -i -E 's:test-sigsegv-catch-stackoverflow[12]::g' gnulib-tests/Makefile.in + '' else null; + configureFlags = # "pr" need not be on the PATH as a run-time dep, so we need to tell # configure where it is. Covers the cross and native case alike.