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

Can't run on arm-musl platform since 1.76.5 #2409

Closed
Floppy opened this issue Oct 24, 2024 · 6 comments · Fixed by #2414
Closed

Can't run on arm-musl platform since 1.76.5 #2409

Floppy opened this issue Oct 24, 2024 · 6 comments · Fixed by #2414
Labels
CLI Issues about the command-line tools enhancement help wanted JavaScript Issues particular to the Node.js distribution

Comments

@Floppy
Copy link

Floppy commented Oct 24, 2024

Context:

  • I'm building a Docker container for arm (32 bit, not 64), on an Alpine as a base image.
  • Alpine uses musl instead of glibc.
  • dart-sass 1.76.5 changed to @parcel/watcher for filesystem events.
  • @parcel/watcher does not currently have a build for the linux-arm-musl platform.

Therefore, sass fails on 32 bit arm musl platforms.

Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-arm-musl. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet.

There are a few possible solutions, I'm not sure which is best:

  1. Do nothing. 32-bit is old hat, maybe this is just a "me" problem. 😄
  2. Get @parcel/watcher to provide an arm-musl build. I've sent them a PR for that, but it might have problems which is why they've not done it.
  3. Allow sass to use their cross-platform watcher-wasm backend if necessary. I think this will need a code change, it seems to have a different require line.
  4. Only throw errors at runtime if watch mode is enabled. In my case, I'm doing a one-off compilation in the Docker build, so there's no need for file watching.

Any thoughts?

@ntkme
Copy link
Contributor

ntkme commented Oct 24, 2024

You can also use the sass-embedded package as a replacement for sass, which supports the same CLI and API. It ships native dart version for arm on linux-musl.

@Floppy
Copy link
Author

Floppy commented Oct 24, 2024

ooh, that's by far the easiest solution for my immediate problem! Thank you!

@nex3 nex3 added enhancement JavaScript Issues particular to the Node.js distribution CLI Issues about the command-line tools labels Oct 24, 2024
@nex3
Copy link
Contributor

nex3 commented Oct 24, 2024

I think it would be reasonable to make @parcel/watcher an optional dependency.

@ntkme
Copy link
Contributor

ntkme commented Oct 28, 2024

To be clear, the title of this issue is a bit misleading. The sass package itself can be installed, just that when starting up sass command or require('sass') API will fail with the error message.

#2414 should be able to fix it.

@Floppy
Copy link
Author

Floppy commented Oct 28, 2024

@ntkme ah sorry, I may have misread the error logs I was looking at, I thought it was an installation failure. I'll update the title! Fantastic work on the fix, much appreciated! 🎉

@Floppy Floppy changed the title Can't install NPM package on arm-musl platform since 1.76.5 Can't run on arm-musl platform since 1.76.5 Oct 28, 2024
@nex3 nex3 closed this as completed in #2414 Nov 1, 2024
@Floppy
Copy link
Author

Floppy commented Nov 4, 2024

The watcher PR got accepted as well, so that now has (or soon will have) an arm-musl build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Issues about the command-line tools enhancement help wanted JavaScript Issues particular to the Node.js distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants