rails / dartsass-rails

Integrate Dart Sass with the asset pipeline in Rails
MIT License
211 stars 42 forks source link

Does not work on Mac M2 Docker Container #40

Closed henrikbjorn closed 1 year ago

henrikbjorn commented 1 year ago

Trying to execute the binary associated with this architecture will result in the following:

/bundle/ruby/3.2.0/gems/dartsass-rails-0.4.1 # ./exe/dartsass 
+ /bundle/ruby/3.2.0/gems/dartsass-rails-0.4.1/exe/aarch64-linux/sass
Segmentation fault
$ uname-m

is aarch64.

I am thinking this might be the same problem that was present in tailwindcss-rails at some point?

Faq commented 1 year ago

Do you get any trace log?

Dockerfile content to see how this was built?

henrikbjorn commented 1 year ago

There is no tracelog other than the binary in the gem spits out Segmmentation Fault.

# syntax=docker/dockerfile:1.4
FROM ruby:3.2-alpine

RUN apk add --update --no-cache \
  alpine-sdk \
  build-base \
  busybox-extras \
  ca-certificates \
  coreutils \
  curl \
  gcompat \
  libcurl \
  libxml2-dev \
  libxslt-dev \
  sqlite \
  tzdata \
  vips \
  yarn

RUN update-ca-certificates
RUN gem install bundler

WORKDIR /app

COPY Gemfile* .

RUN bundle config set path "/bundle" && \
    bundle config build.nokogiri --use-system-libraries

COPY --link . .

ENV PATH /app/bin:$PATH

EXPOSE 3000

ENTRYPOINT ["/app/docker-entrypoint.sh"]

CMD ["bin/dev"]

I assume it might be because of Alpine and it not having glibc or something. Works on Arm with the ruby:3.2-slim

shyim commented 1 year ago

dart is not working with alpine. It's an known issue