Skip to content
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

GitHub Actions backend: Builds aren't parallelized? #421

Closed
RyanGlScott opened this issue Dec 15, 2020 · 3 comments · Fixed by #422
Closed

GitHub Actions backend: Builds aren't parallelized? #421

RyanGlScott opened this issue Dec 15, 2020 · 3 comments · Fixed by #422

Comments

@RyanGlScott
Copy link
Contributor

When building dependencies in haskell-ci–generated GitHub Actions configuration, the installation completely lacks any parallelism. (Example.) I wonder if the backend needs to use -j2 somewhere, like what the Travis backend uses?

@RyanGlScott RyanGlScott changed the title GitHub Actions backend: Build aren't parallelized? GitHub Actions backend: Builds aren't parallelized? Dec 15, 2020
@RyanGlScott
Copy link
Contributor Author

The Bash backend, judging from the source code, seems to suffer from a similar problem. Curiously, -j2 is used when installing doctest:

run_cmd_if range "$CABAL v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.17'"

But nowhere else.

@phadej
Copy link
Collaborator

phadej commented Dec 15, 2020

Yes. With bash it's tricky, as it depends on users machine/current use, which -j is reasonable. For GitHub Actions we should use whatever cores GHA provides. Please find the environment info, and add/change according -j.

The actual build is better to keep -j1 though. Why? Because interleaved output is hard to parse. This can be configurable, but default should be no parallelism.

@RyanGlScott
Copy link
Contributor Author

For GitHub Actions we should use whatever cores GHA provides. Please find the environment info, and add/change according -j.

According to this, GitHub Actions virtual machines use 2-core CPUs, so -j2 seems reasonable.

The actual build is better to keep -j1 though. Why? Because interleaved output is hard to parse. This can be configurable, but default should be no parallelism.

Absolutely. To be clear, when I say "parallelism", I'm exclusively referring to installation of dependencies, not building the main packages themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants