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
Prevent rake-compiler from overriding required_ruby_version? #153
Comments
Super-ugly workaround: gem_spec = Gem::Specification.load("sassc.gemspec")
# HACK: Prevent rake-compiler from overriding required_ruby_version,
# because the shared library here is Ruby-agnostic.
# See https://github.com/rake-compiler/rake-compiler/issues/153
module FixRequiredRubyVersion
def required_ruby_version=(*); end
end
Gem::Specification.prepend(FixRequiredRubyVersion)
Rake::ExtensionTask.new('libsass', gem_spec) do |ext|
...
end |
sass/sassc-ruby@f1c7677#diff-52c976fc38ed2b4e3b1192f8a8e24cffL25 is expected code for this case. The rake-compiler/lib/rake/extensiontask.rb Line 282 in 18b335a
|
Doesn't work when I override in the block. Perhaps it is invoked earlier? |
How to reproduce your problem? |
This is needed for gems that use the ffi gem instead of libruby. Fixes rake-compiler#153
This is needed for gems that use the ffi gem instead of libruby. Fixes rake-compiler#153
@kou Looks like it may be possible to override it in the block (not sure why it seemed to not work for me). Still, I'd like to add a setting for this instead, as there is another thing to check when the gem doesn't use libruby: there should only be one RUBY_CC_VERSION. |
Next rake-compiler-dock version will set |
The Rake::ExtensionTask.new('my_extension', gem_spec) do |ext|
ext.cross_compiling do |spec|
spec.required_ruby_version = [">= 2.5", "< 3.2.dev"]
end
end The issue with not calling the cross_compiling block is solved in #171 . So can this issue be closed now? |
I agree that we can probably close it, given that the workaround exists. |
I'm working on a gem that uses FFI and doesn't use libruby directly.
This means it doesn't need an
.so
file per Ruby version, and that the pre-compiled binary gems should have the samerequired_ruby_version
as the original gemspec.rake-compiler currently does this when cross-compiling:
rake-compiler/lib/rake/extensiontask.rb
Lines 261 to 264 in 18b335a
Is there any way to override this behaviour?
The text was updated successfully, but these errors were encountered: