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

[Optimization] Split prebuilds to OS specific packages #602

Open
belozer opened this issue Dec 23, 2024 · 5 comments
Open

[Optimization] Split prebuilds to OS specific packages #602

belozer opened this issue Dec 23, 2024 · 5 comments
Labels
enhancement Indicates new feature requests

Comments

@belozer
Copy link

belozer commented Dec 23, 2024

Currently, the pact-core package includes binary versions of the server for all platforms. And the package weighs 110 MB.

CI does not require all binary versions, only linux-x64 is needed... But instead, each CI launch downloads an extra 80 MB, which also affects the speed of passing the tests.

It is necessary to create your own package for each platform, as optionalDepencies with restrictions on OS and Arch.

Example:
https://github.com/biomejs/biome/blob/main/packages/%40biomejs/biome/package.json#L52-L61

And platform specific package:
https://github.com/biomejs/biome/blob/main/packages/%40biomejs/cli-linux-x64-musl/package.json

@belozer belozer added the enhancement Indicates new feature requests label Dec 23, 2024
@belozer belozer changed the title [Optimization] Split prebuilds to OS specif packages, reduce package size [Optimization] Split prebuilds to OS specific packages for reduce package size Dec 23, 2024
@belozer belozer changed the title [Optimization] Split prebuilds to OS specific packages for reduce package size [Optimization] Split prebuilds to OS specific packages Dec 23, 2024
@mefellows
Copy link
Member

It's a fair point. Previously we couldn't separate out the alpine/musl builds from the others, but that's a possibility now (both in terms of the npm toolchain, and the fact that we've removed the Ruby CLI from the distribution now).

Would you be open to a PR?

@YOU54F
Copy link
Member

YOU54F commented Dec 23, 2024

i’ve done the same for pact-js-cli and in my fork of pact-js-core

master...YOU54F:pact-js-core:feat/opt_dep_plat_arch_specific_packages

the linux arch specific deps will need to contain musl and non musl deps, as npm doesn’t provide the ability to distinguish between at install time

@YOU54F
Copy link
Member

YOU54F commented Dec 23, 2024

But instead, each CI launch downloads an extra 80 MB, which also affects the speed of passing the tests.

i disagree that this will affect the speed of your tests in any meaningful way.

@YOU54F
Copy link
Member

YOU54F commented Dec 23, 2024

hmm looks like libc field is supported but only in later versions of npm

npm/rfcs#438

@JP-Ellis
Copy link
Contributor

That will be a very nice improvement, speeding up CI times (by virtue for having less to download and unpack, even if cached). Especially now that NPM supports the musl and gnu flavours. Looks like support for these flavours landed a year ago, so it should be quite safe to use that now.

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

No branches or pull requests

4 participants