-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
feat: add musl target support in npm pakcage #1067
Conversation
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
fddb0c3
to
873b8c3
Compare
fc00613
to
fcfd936
Compare
This is something we could add to our documentation, what do you think? Maybe here: https://biomejs.dev/guides/manual-installation/#supported-platforms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's awesome @matteosacchetto, thank you so much for this contribution! 🙏
I agree that it should be something to mention, though I do not know where we could mention it. |
We could add a new heading |
Going to merge this, we can write the documentation in a different PR :D |
Summary
In this PR i am adding support for the linux musl target in the npm package
@biomejs/biome
.The idea of adding this feature was initially introduced in discussion #946, since from version 1.40 biome is now built also for the linux musl target thanks to PR #821.
In this PR i am modifying the following files:
generate-packages.mjs
: to add the generation of the packages also for linux-musl and add libc field to package.json (reference issue: Support libc field in package.json pnpm/pnpm#4454)postinstall.js
: to identify if on linux-musl and select the correct packageisMusl
function was implemented as suggested in Add `musl` detection in `postinstall.js` #946 following the implementation of detect if we are installing musl or gnu target microsoft/vscode-ripgrep#25, with the only difference that I used the sync version of exec.biome/bin/biome
: add linux-musl detectionMinore issue, though I do not know if it is solvable, on linux with npm it will install both
@biomejs/cli-linux-${arch}
and@biomejs/cli-linux-${arch}-musl
, since npm will install based on arch and platform (which islinux
for both packages).Test Plan
I tested the
isMusl()
function on both linux and alpine to check it was working properly.I checked that
getName()
was returning the correct names for the various platforms and arch.I tested locally, by running
npm pack
and installing them locally and on alpine, the correct musl target is run.Tested also with
bun
on alpine, and withpnpm
.