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 dart-sass #1924

Closed
ElnuDev opened this issue Mar 27, 2023 · 4 comments
Closed

Can't run dart-sass #1924

ElnuDev opened this issue Mar 27, 2023 · 4 comments

Comments

@ElnuDev
Copy link

ElnuDev commented Mar 27, 2023

I'm trying to use dart-sass-embedded for Dart Sass support in Hugo, but as I'm having the same issue on dart-sass and its the larger repository, I'm asking here. The README claims that the releases are standalone and ready to run, but this isn't being the case for me.

When I download dart-sass-1.60.0-linux-x64.tar.gz, extract it, and run ./sass it tells me ./sass: line 20: /home/elnu/Downloads/dart-sass/src/dart: cannot execute: required file not found, even though this file exists. If I run ./src/dart it tells me bash: ./src/dart: cannot execute: required file not found. What dependencies am I missing?

Thanks in advance!

@ntkme
Copy link
Contributor

ntkme commented Mar 27, 2023

This error usually means your Linux distribution is not built with glibc. The official dart sdk release only supports glibc as of today. However, building dart sdk with musl (e.g. alpine linux) or bionic (e.g. android ndk/termux) has been possible.

Although it is not official (I’m just a frequent contributor here), I have been providing dart-sass and dart-sass-embedded releases for some non-glibc systems:

In fact, I contributed alpine/musl support in official dart sdk repository a while ago: dart-lang/sdk@afe9219

The main challenge to make this official is that the build process for musl isn’t very straightforward that the dart team has not committed to make it part of their official release process, so we have to use my unofficial build of dart sdks:

There sdk projects are completely automated with GitHub Actions and will keep up with official dart releases as much as possible.

@nex3 I’m happy to continue providing unofficial releases for these systems as it was highly demanded (especially in the Ruby community where alpine was too popular to be ignored). Any thoughts on how can we make it more official?

@ntkme
Copy link
Contributor

ntkme commented Mar 27, 2023

Another possibility is that if you are using NixOS or some system that glibc is not installed in a standard location, you have to patchelf the dart vm binary.

@ElnuDev
Copy link
Author

ElnuDev commented Mar 27, 2023

Sorry I didn't mention earlier, but yes, I am on NixOS. I'll check out patchelf, thanks!

@nex3
Copy link
Contributor

nex3 commented Mar 27, 2023

@ntkme I'm open to using these custom Dart builds to distribute musl- and Android-compatible binaries. It'll be tricky to integrate with the Node.js embedded host, though, since npm doesn't have a way to select different packages based on which libc is available. We'd probably need to distribute both the musl and the glibc binaries in each Linux package.

Closing this issue out for now since it sounds like the immediate problem has been resolved, and I don't think there's anything we can do in the embedded host to avoid depending on a specific libc path on NixOS.

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

No branches or pull requests

3 participants