ai / autoprefixer-rails

Autoprefixer for Ruby and Ruby on Rails
https://twitter.com/autoprefixer
MIT License
1.22k stars 109 forks source link

Version 10+ breaks with a sassc segmentation fault #191

Closed aschrafl closed 3 years ago

aschrafl commented 4 years ago

When using Version 10+ I end up in a segmentation fault of sassc while pre-compiling. When using Version 9.x all works nicely.

The segmentation fault is in the sassc gem /lib/sassc/engine.rb:43 Tried to figure out if the stems from the ruby code within autoprefixer-rails or the javascript and must assume it is an interaction between the two of them.

Not sure if this can and will be fixed within autoprefixer-rails but since sassc is officially deprecated this is where I'll start finding help. Thanks

albb0920 commented 4 years ago

Are you using sprockets 4.x ? see https://github.com/rails/sprockets/issues/633

BTW, I believe there's nothing in this gem that could cause sassc to break.

aschrafl commented 4 years ago

Yes I'm using sprockets 4.x. I've also traced this problem to look similar to what other people experience with sprockets 4.x. Unfortunately I've tested if downgrading sprockets to 3.x helps but had to find out it doesn't.

aschrafl commented 4 years ago

Tracked it further to an incompatability between rails_admin together with Version 10.x of this gem.

aschrafl commented 4 years ago

rails_admin uses xxx.scss.erb files. Could be that this comes from sprockets 4.x are not automatically chainable? https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#adding-erb-support-to-your-extension

albb0920 commented 4 years ago

Can you reproduce this with a minimal rails app?

I still doubt this has anything to do with the changes from 9.x to 10.x . https://github.com/ai/autoprefixer-rails/commit/177007d3adbc93d91f9f82cb051e350e0914fcbd As you can see in this commit, there's little code change in ruby side. And segfaults generally should be dealt with the gem providing the native extension (i.e. sassc)

aschrafl commented 3 years ago

After much experimenting I've found out that with the newest 10.x release this disappears. Still not yet sure what it was but for the moment it works :+1: