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

sass-embedded fails to build on FreeBSD14 #227

Open
0x1eef opened this issue Jul 23, 2024 · 4 comments
Open

sass-embedded fails to build on FreeBSD14 #227

0x1eef opened this issue Jul 23, 2024 · 4 comments
Assignees

Comments

@0x1eef
Copy link

0x1eef commented Jul 23, 2024

Hey 👋

I am unable to install sass-embedded on FreeBSD14:

$ gem install sass-embedded
Fetching sass-embedded 1.77.8                                                       
Installing sass-embedded 1.77.8 with native extensions  
rake aborted!                                                                                                                                                           
NotImplementedError: dart-sass for x86_64-freebsd14 not available at https://github.com/sass/dart-sass/releases/tag/1.77.8 (NotImplementedError) 

The error makes sense; there's no prebuild available for FreeBSD (Or OpenBSD, or NetBSD).
Could we build from source instead (during gem install) ?

@ntkme
Copy link
Member

ntkme commented Jul 23, 2024

Dart VM does not have BSD support: dart-lang/sdk#52374. There was an experimental BSD port by community at some point but was completely abandoned. Porting Dart SDK to BSD would be the most performant and preferred way, but it is not an easy task.

You can try running Dart VM in Linux jail, but I’m not sure if it will work or not. To try this you will have to create a shell script that runs dart-sass command line inside Linux jail. Create a folder named dart-sass, then put the shell script as dart-sass/sass with permission 0755. Create a tarball containing the dart-sass folder, then gem install sass-embedded -- DART_SASS=/path/to/tarball. I don't know much about tcsh syntax, but here is an example of the wrapper script written in bash:

#!/bin/sh
chroot /compat/ubuntu /path/inside/linux/jail/to/dart-sass/sass "$@"

As an alternative, you can try file an issue on dart-sass to support embedded compiler (sass --embedded) in pure JS mode. It will be slow, but at least allow this gem to be working on BSD via node JS.


Without the support from Dart VM or Dart Sass, there isn’t much this repo can do.

@0x1eef
Copy link
Author

0x1eef commented Jul 23, 2024

Dart VM does not have BSD support: dart-lang/sdk#52374. There was an experimental BSD port by community at some point but was completely abandoned. Porting Dart SDK to BSD would be the most performant and preferred way, but it is not an easy task.

Alright 😞

As an alternative, you can try file an issue on dart-sass to support embedded compiler (sass --embedded) in pure JS mode. It will be slow, but at least working on BSD via node JS.

I have been using https://www.npmjs.com/package/sass. It works okay. The big downside is I can't use any Ruby packages that depend on sass-embedded, such as the nanoc plugin nanoc-dart-sass.

Without the support from Dart VM or Dart Sass, there isn’t much this repo can do.

No worries. Thanks a lot for the explanation, links and suggestions. Gonna close this one.

@smortex
Copy link

smortex commented Oct 27, 2024

A note for future me (and that can help other users) as I did this a few month ago and got hit by this again today: the FreeBSD Linux compatibility can be used to run the Linux dart/sass binary and install the gem.

As described above by @ntkme, one can download the dart-sass-*-linux-x64.tar.gz following the link in the error message, and set the DART_SASS environment variable to the path of this file:

$ DART_SASS=~/Downloads/dart-sass-1.80.4-linux-x64.tar.gz bundle install

@ntkme
Copy link
Member

ntkme commented Oct 28, 2024

Real BSD support will be coming soon: sass/dart-sass#2413

@ntkme ntkme reopened this Oct 28, 2024
@ntkme ntkme self-assigned this Oct 28, 2024
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