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

Build in parallel and enable caching #718

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Build in parallel and enable caching #718

wants to merge 2 commits into from

Conversation

emersion
Copy link
Member

@emersion emersion commented Nov 21, 2024

Use lerna to build in parallel

lerna is already a dependency. Use it so that packages get built
in parallel instead of sequentially.

Cache builds with nx

Configure nx (used under-the-hood by lerna) to cache build
artifacts. Significantly decreases build time when a single
sub-package has changed.


Note that this relies more heavily on lerna, which on one hand is already a dependency, and on the other hand is quite overkill (e.g. supports sending build tasks to a remote machine)...

There is also a catch: on my machine nx just hangs because of nrwl/nx#27494 (due to a ~/.gitignore file).

An alternative would be to switch from rollup to a tool which supports on-disk cache, and then combine this with run-p. (With that approach we'd still need to spawn the build system for each sub-package when nothing has changed so would be a bit slower than nx. Also dependency tracking would be manual.)

lerna is already a dependency. Use it so that packages get built
in parallel instead of sequentially.

Signed-off-by: Simon Ser <[email protected]>
Configure nx (used under-the-hood by lerna) to cache build
artifacts. Significantly decreases build time when a single
sub-package has changed.

Signed-off-by: Simon Ser <[email protected]>
@emersion emersion requested a review from a team as a code owner November 21, 2024 17:26
@emersion
Copy link
Member Author

Seems like this causes breakage for @theocrsb as well. (Apple silicon doesn't seem to be well-supported by nx.)

@theocrsb
Copy link
Contributor

Seems like this causes breakage for @theocrsb as well. (Apple silicon doesn't seem to be well-supported by nx.)

Yes, it didn't work for me

Copy link
Member

@ElysaSrc ElysaSrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on macOS (Apple Silicon)

@emersion
Copy link
Member Author

@ElysaSrc has found nrwl/nx#27263 which could explain @theocrsb's issue.

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

Successfully merging this pull request may close these issues.

3 participants