Fix sassc: copy libsass into ext dir when Ruby >= 4.1#477
Fix sassc: copy libsass into ext dir when Ruby >= 4.1#477eightbitraptor merged 1 commit intomainfrom
Conversation
RubyGems no longer copies compiled extensions into the gem's lib/ tree (ruby/rubygems@1614b036f7), breaking sassc which uses FFI with hardcoded paths. This commit copies libsass from the extensions directory into ext where sassc's native.rb expects it. Sassc is deprecated and publically archived anyway so there seems little point updating this upstream. I chose not to use Gem.configuration.install_extension_in_lib. Because it would set the behaviour for all gems in the bundle, and we'd still have to copy manually anyway, becuase the bundle isn't rebuilt between runs.
|
Does the shipit benchmark compile sass files? If it's loaded in |
6db3967 to
d7e4d3e
Compare
|
I don't think that's going to be possible because the dependency chain that ends up requiring
|
d7e4d3e to
9aa80cf
Compare
| # sassc uses FFI with hardcoded paths to find its compiled libsass shared object. | ||
| # RubyGems 4.x (Ruby 4.1+) no longer copies extensions into the gem's lib/ tree, | ||
| # so sassc can't find it. Copy it into place. | ||
| if RUBY_VERSION >= "4.1" |
There was a problem hiding this comment.
I think we should ideally check the rubygems version instead. It's possible to update rubygems for an older Ruby.
There was a problem hiding this comment.
| if RUBY_VERSION >= "4.1" | |
| unless Gem.install_extension_in_lib |
We may use Gem.install_extension_in_lib instead of version condition.
RubyGems no longer copies compiled extensions into the gem's lib/ tree (ruby/rubygems@1614b036f7), breaking sassc which uses FFI with hardcoded paths.
This commit copies libsass from the extensions directory into ext where sassc's native.rb expects it. Sassc is deprecated and publically archived anyway so there seems little point updating this upstream.
I chose not to use
Gem.configuration.install_extension_in_lib. Because it would set the behaviour for all gems in the bundle, and we'd still have to copy manually anyway, becuase the bundle isn't rebuilt between runs.