-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
checkPhase of buildGoModule is very slow #285362
Comments
Maybe something like |
|
#284568 will help address this. |
Could we not make the argument list too big for large projects this way? |
That's possible but I wonder how probable that is. @katexochen if you get a chance, can you try your PR to build Kubernetes or some other large project? |
I can't think of a reason this shouldn't work with big argument lists.
Kubernetes package isn't affected by this, as its derivation overwrites the buildPhase and also don't execute tests. Any other idea for larger projects to test? |
Performance of master:
on #284568:
But the package could also use some refactoring and cleanup. Especially, I would recommended to set |
Your patch basically does
I'd probably use |
So I reduced it down to |
That's what #284568 does. |
Describe the bug
When running the default checkPhase of
buildGoModule
, it isn't parallelized at all: afor
loop iterates through each directory where Go code was compiled and executesgo test
:nixpkgs/pkgs/build-support/go/module.nix
Lines 276 to 278 in b8b232a
This is incredibly slow, for instance the last build of Grafana on master spent 20min on the test suite: https://cache.nixos.org/log/ninyms7zfs2naq6qph1ysb6zgib1xxp3-grafana-10.3.1.drv
The actual runtime of each case doesn't seem that high, so the biggest bottleneck is probably the compilation of test code. This should be parallelized.
Steps To Reproduce
Steps to reproduce the behavior:
nix-build -A grafana
.Expected behavior
Being able to run tests truly in parallel.
Screenshots
n/a
Additional context
n/a
Notify maintainers
cc @kalbasit @Mic92 @zowoq
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.n/a
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: