phoenixframework / tailwind

An installer for tailwind
MIT License
475 stars 61 forks source link

Fails when running in CI #7

Closed abel-cherinet-liqid closed 1 year ago

abel-cherinet-liqid commented 2 years ago

mix tailwind default --minify works ok locally but seems to fail in GCP Cloud Build where the reason doesn't seem to be obvious.

deploy.yml

  - name: 'gcr.io/something/docker-base-images/alpine-elixir-builder'
    id: 'run tailwind'
    entrypoint: mix
    args: [ 'tailwind', 'default', '--minify' ]

output

17:08:26.506 [debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.0.3/tailwindcss-linux-x64
** (Mix) `mix tailwind default --minify` exited with 2
fertapric commented 2 years ago

@abel-cherinet-liqid I run into the same issue and fixed it running apk add --no-cache gcompat. More info here.

Hope it helps! 🙂

abel-cherinet-liqid commented 2 years ago

Unfortunately not, also tried installing libc6-compat and still same error

mveytsman commented 2 years ago

@abel-cherinet-liqid does adding the combination of build-base and gcompat work for you?

mveytsman commented 2 years ago

This is going to keep coming up for alpine users - I opened a discussion to switch to static builds on tailwind's side here: https://github.com/tailwindlabs/tailwindcss/discussions/6785

iautom8things commented 2 years ago

@abel-cherinet-liqid does adding the combination of build-base and gcompat work for you?

Thanks for this discussion! I came across this issue and tried following the suggestions, but it seems to run at odds with similar/related issues with the dart-sass library+installer:

From this issue: https://github.com/CargoSense/dart_sass/issues/13

A PR was opened that includes the following notes with their fix:

Notes: The Alpine package gcompat vs libc6-compat will not work.

Is there a way that we can satisfy both dependencies in alpine to be able to run the dart-sass and tailwindcss installers?

abel-cherinet-liqid commented 2 years ago

@fertapric @mveytsman sorry for late response, I figured later that adding gcompat worked! I was trying to install gcompat as a GCP Cloud Build step which didnt persist to the tailwind step. Now I installed gcompat in my docker file and seems to work fine this time. Thank you for the help!

mveytsman commented 2 years ago

I got a PR switching the build type to linuxstatic into tailwind (https://github.com/tailwindlabs/tailwindcss/pull/6914)

this will actually fix the problem (and related issues on nixos)

Can we keep this issue open until a new version is released and we can set that as the default in this package?

philipgiuliani commented 2 years ago

This should be included in Tailwind CSS 3.0.12. So I guess this can be closed now ☺️