sass / dart-sass

The reference implementation of Sass, written in Dart.
https://sass-lang.com/dart-sass
MIT License
3.96k stars 360 forks source link

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

Open Floppy opened 6 days ago

Floppy commented 6 days ago

Context:

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 commented 5 days ago

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 commented 5 days ago

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

nex3 commented 5 days ago

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

ntkme commented 1 day ago

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 commented 1 day ago

@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! 🎉