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

[DOCS] add a note that this bundle does not work with alpine #31

Closed
jaapio opened this issue Nov 10, 2023 · 23 comments · Fixed by #51
Closed

[DOCS] add a note that this bundle does not work with alpine #31

jaapio opened this issue Nov 10, 2023 · 23 comments · Fixed by #51

Comments

@jaapio
Copy link

jaapio commented Nov 10, 2023

This bundle is downloading dart-sass automatically which is perfectly ok when running on windows, macos, linux. Except for some distro's like alpine. Alpine is quite popular for people using docker because of the image size. But this comes with a different libc, which is not the version dart-sass is compiled with.

Their is no alternative download available with musl-libc. See sass/embedded-host-node#155

@WebMamba
Copy link
Contributor

I had a similar issue, do you know if there is a way to install some packages on Alpine to make it compatible?

@smnandre
Copy link
Contributor

If the usage is in a docker, maybe naive question, but is it not possible to add dart-sass to your build ?

https://pkgs.alpinelinux.org/package/edge/testing/x86_64/dart-sass

@jaapio
Copy link
Author

jaapio commented Nov 18, 2023

That's a test repo you link. There is no stable release yet. But as this is definitely not going to work for everyone, I think it's wise for the maintainers of this project to state that alpine is not supported. Until a real solution is available for everyone..

@Yoann-TYT
Copy link

Here, they talk about an unofficial build of SDK

sass/dart-sass#617 (comment)

I tried this build https://github.com/dart-musl/dart-sass/releases and it works successfully on alpine.

/app/var/dart-sass # wget https://github.com/dart-musl/dart-sass/releases/downlo
ad/1.69.5/dart-sass-1.69.5-linux-arm64.tar.gz
tar -xvzf dart-sass-1.69.5-linux-arm64.tar.gz
/app/var/dart-sass # ./sass 
Compile Sass to CSS.

@WebMamba
Copy link
Contributor

Ho so nice! Thanks for sharing!
We can do a PR, that detects if the os is Alpine, and if so download this non official build

@smnandre
Copy link
Contributor

We can do a PR, that detects if the os is Alpine, and if so download this non official build

I'm not sure you should vouch for a non-official binary like that.. but just my 2 cents :)

And if you do it for Alpine, will you too for ?

For me you would better:

  • allow to configure the bundle to set the path to the binary (done i think)
  • detect the binary on the OS automatically like the symfony-cli does with php bin
  • eventuallly suggest this build in the README of the bundle

@Yoann-TYT
Copy link

@smnandre I agree with you , relying it on unofficial binary can be a bit risky ;)

I my case, I use https://github.com/dunglas/symfony-docker
Adding documentation to describe what we should add in a Dockerfile to build this binary seems like a good idea

@LaurentSanson
Copy link
Contributor

Hi @Yoann-TYT ,

I agree to add a documentation as I'm completely in the same position here. I've been working with Kevin's template and I can't make this bundle work...

Could you please share how you manage it within your Dockerfile?

Thanks !

@haivala
Copy link

haivala commented Dec 15, 2023

Here, they talk about an unofficial build of SDK

sass/dart-sass#617 (comment)

I tried this build https://github.com/dart-musl/dart-sass/releases and it works successfully on alpine.

/app/var/dart-sass # wget https://github.com/dart-musl/dart-sass/releases/downlo
ad/1.69.5/dart-sass-1.69.5-linux-arm64.tar.gz
tar -xvzf dart-sass-1.69.5-linux-arm64.tar.gz
/app/var/dart-sass # ./sass 
Compile Sass to CSS.

I'm using php:8.2-fpm-alpine image and I get this error message when I try to run sass
dart-sass/src/dart: line 1: syntax error: unexpected word (expecting ")")
Has anyone solved this one with this workaround above?

@Yoann-TYT
Copy link

Yoann-TYT commented Dec 15, 2023

It is because my script is for Mac.

I wrote a custom shell to fetch the right binary https://gist.github.com/Yoann-TYT/560b85aa6af5f1c9530bc9c634b87d80

And I add it in my Dockerfile

COPY --link --chmod=755 frankenphp/fetch-dart-sass.sh /usr/local/bin/fetch-dart-sass
RUN fetch-dart-sass

Hope it will be useful for you @LaurentSanson @haivala :)

@haivala
Copy link

haivala commented Dec 15, 2023

ah, true. Why didn't I see that

@LaurentSanson
Copy link
Contributor

Thanks @Yoann-TYT , I'm gonna give it another try today 🎉

Hopefully this bundle will soon work with alpine !

@weaverryan
Copy link
Contributor

It probably makes sense to add a note somewhere in the docs about Alpine and just point to this issue for now. Can someone make a PR?

@smnandre
Copy link
Contributor

Things are moving on the Sass side : sass/dart-sass#2149

@smnandre
Copy link
Contributor

It is released: https://github.com/sass/dart-sass/releases/tag/1.69.6

Provide official releases for musl LibC and for Android.

@smnandre
Copy link
Contributor

smnandre commented Jan 2, 2024

If someone (using Alpine) can test this patch and say what is working / not that'd be great :)

https://github.com/smnandre/sass-bundle/tree/feat/download-alpine-binary

@LaurentSanson
Copy link
Contributor

I'll give it a try tomorrow @smnandre 💪

@LaurentSanson
Copy link
Contributor

Hello @smnandre , I'm trying to require the package, but it's not working, it's like the package doesn't exists. I've tried with yours and mine, same error

Root composer.json requires laurentsanson/sass-bundle, it could not be found in any version, there may be a typo in the package name.

@yivi
Copy link

yivi commented Jan 3, 2024

@LaurentSanson That's not how you request a fork.

Add this to your composer.json.

"repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/smnandre/sass-bundle"
    }
  ],

and change the version constraint for sass-bundle to dev-main to get the patched version.

@bocharsky-bw
Copy link
Member

bocharsky-bw commented Jan 3, 2024

Instead of dev-main I believe you need to use dev-feat/download-alpine-binary to match the branch where changes are made

@yivi
Copy link

yivi commented Jan 3, 2024

Instead of dev-main I believe you need to use dev-feat/download-alpine-binary to match the branch where changes are made

@bocharsky-bw You are right, I'm sleepy. Need more tea before writing on the interweb.

Thanks.

@smnandre Works for me 👍

@bocharsky-bw
Copy link
Member

Awesome, thanks for double-checking!

Then #51 is almost ready, we just need to fix related failed tests there

@LaurentSanson
Copy link
Contributor

LaurentSanson commented Jan 3, 2024

Thanks guys, I've got the package locally now. And I really need to sleep too 😃

But it's still not working, same issue for me when trying to bin/console sass:build --watch, the /app/var/dart-sass/src/dart: not found error is here

EDIT :

After removing my var folder, I can confirm that it is working too 👍

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

Successfully merging a pull request may close this issue.

9 participants