-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnugrep: enable parallel build and tests #236229
Conversation
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.
Since you are already touching the package, could you pick this darwin patch as well so Hydra is more likely to succeed with the rebuild? |
Sounds good! Will take me a few hours. |
Added --- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -19,2 +19,4 @@ stdenv.mkDerivation {
- # 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 '' Tested eval as:
Looks expected. |
gnugrep no longer hangs with the Darwin patch, but I get a test failure (Rosetta 2, macOS 13.4).
I modified the test script to cat the actual contents of
|
Looks like an emulator deficiency. Is it generally able to run testsuites of most other programs? |
Normally, yes. This particular test creates a pathological file with a million left-parens then tries to grep it. The test wants grep to crash, but it doesn’t crash with the expected error message ( If you perform the test manually (create the file, try to grep it), it does crash in the expected way. There’s something about the test environment it sets up that causes the Rosetta 2 error. |
Aha, that makes sense. I wonder if |
Darwin support sandboxing, which normally works with Rosetta 2. However, while I normally have the sandbox enabled, it was disabled when I captured the output with the Rosetta 2 error. |
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
Added --- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -33 +33,2 @@ stdenv.mkDerivation {
- 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); |
Let's declare it good enough for |
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).
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).
On a 16-core system number changes are:
2.5x speedup. If ./configure phase was faster the change would be even more substantial.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)