From e27de0051702e7c134b2e5746e116b44302dc15e Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 6 Jun 2023 09:02:50 +0100 Subject: [PATCH 1/3] gnugrep: enable parallel build and tests On a 16-core system number changes are: - before: 1m34s - after: 39s 2.5x speedup. If ./configure phase was faster the change would be even more substantial. --- pkgs/tools/text/gnugrep/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 75c6f6950737..e0f4e5f8d4aa 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation { export MKDIR_P="mkdir -p" ''; + enableParallelBuilding = true; + # Fix reference to sh in bootstrap-tools, and invoke grep via # absolute path rather than looking at argv[0]. postInstall = From fd76e6c2ab5f9b0d2468215fe16187247b092bc5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 6 Jun 2023 20:10:06 +0100 Subject: [PATCH 2/3] gnugrep: disable gnulib tests on x86_64-darwin as well --- pkgs/tools/text/gnugrep/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index e0f4e5f8d4aa..0b8e5f803b35 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -16,8 +16,10 @@ stdenv.mkDerivation { hash = "sha256-HbKu3eidDepCsW2VKPiUyNFdrk4ZC1muzHj1qVEnbqs="; }; - # Some gnulib tests fail on Musl: https://github.com/NixOS/nixpkgs/pull/228714 - postPatch = if stdenv.hostPlatform.isMusl then '' + # Some gnulib tests fail + # - on Musl: https://github.com/NixOS/nixpkgs/pull/228714 + # - on x86_64-darwin: https://github.com/NixOS/nixpkgs/pull/228714#issuecomment-1576826330 + postPatch = if stdenv.hostPlatform.isMusl || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) then '' sed -i 's:gnulib-tests::g' Makefile.in '' else null; From bf442ea3fe08a5e00740942550ea54ebfdf04759 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 7 Jun 2023 23:26:07 +0100 Subject: [PATCH 3/3] gnugrep: disable tests x86_64-darwin When running on Rosetta 2 emulator (x86_64-darwin biaries executed on aarch64-darwin) `stack-overflow` test fails as: rosetta error: unexpectedly need to EmulateForward on a synchronous exception x86_rip=0x4303486096 arm_pc=0x4303949136 num_insts=6 inst_index=4 x86 instruction bytes: 0x6215344901283465301 0x17041981987679720769 --- pkgs/tools/text/gnugrep/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix index 0b8e5f803b35..1e339ee3e629 100644 --- a/pkgs/tools/text/gnugrep/default.nix +++ b/pkgs/tools/text/gnugrep/default.nix @@ -30,7 +30,8 @@ stdenv.mkDerivation { # cygwin: FAIL: multibyte-white-space # freebsd: FAIL mb-non-UTF8-performance - doCheck = !stdenv.isCygwin && !stdenv.isFreeBSD; + # x86_64-darwin: fails 'stack-overflow' tests on Rosetta 2 emulator + doCheck = !stdenv.isCygwin && !stdenv.isFreeBSD && !(stdenv.isDarwin && stdenv.hostPlatform.isx86_64); # On macOS, force use of mkdir -p, since Grep's fallback # (./install-sh) is broken.