rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.67k stars 190 forks source link

Support for unified Integer class in Ruby 2.4+ #413

Closed koic closed 7 years ago

koic commented 8 years ago

Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005

Due to this change, following error happened on the combination of this gem and ruby-2.4.0dev.

% ruby -v
ruby 2.4.0dev (2016-05-18 trunk 55053) [x86_64-darwin13]
% bundle exec rake compile spec
(snip)
/Users/koic/src/therubyracer/lib/v8/conversion.rb:23:in `include': wrong argument type Class (expected Module) (TypeError)
        from /Users/koic/src/therubyracer/lib/v8/conversion.rb:23:in `block (2 levels) in <top (required)>'
        from /Users/koic/src/therubyracer/lib/v8/conversion.rb:22:in `class_eval'
        from /Users/koic/src/therubyracer/lib/v8/conversion.rb:22:in `block in <top (required)>'
        from /Users/koic/src/therubyracer/lib/v8/conversion.rb:21:in `each'
        from /Users/koic/src/therubyracer/lib/v8/conversion.rb:21:in `<top (required)>'
        from /Users/koic/src/therubyracer/lib/v8.rb:22:in `require'
        from /Users/koic/src/therubyracer/lib/v8.rb:22:in `<top (required)>'
        from /Users/koic/src/therubyracer/spec/spec_helper.rb:1:in `require'
        from /Users/koic/src/therubyracer/spec/spec_helper.rb:1:in `<top (required)>'
        from /Users/koic/src/therubyracer/spec/c/array_spec.rb:1:in `require'
        from /Users/koic/src/therubyracer/spec/c/array_spec.rb:1:in `<top (required)>'
        from /Users/koic/.rbenv/versions/2.4.0-dev/lib/ruby/gems/2.4.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load'

This PR will be fixed it.

Thanks.

ignisf commented 8 years ago

Hi, thank you for the PR!

Do you expect any backwards compatibility issues due to this change?

ignisf commented 8 years ago

While I don't fancy the notion of supporting anything not supported by upstream at all, Ubuntu LTS releases for example will keep the defaults to 1.8.7 until 2018 (for 12.04) and 1.9.3 until 2020 (for 14.04). We at least should mark the gem explicitly as incompatible with them if necessary :)

koic commented 8 years ago

Thanks for your reply. This patch expect to backward compatibility in Ruby 2.0, 2.1, 2.2, 2.3.

However, Ruby 1.9 and 1.8 that has not been confirmation, because following installation error.

% bundle install
(snip)
Gem::InstallError: gem-compiler requires Ruby version >= 2.0.0.

Ummm.

ignisf commented 8 years ago

Fair point, hadn't noticed that

aviat commented 7 years ago

@ignisf support for 1.9.3 was removed from Travis 4 months ago: https://github.com/cowboyd/therubyracer/commit/72b094c8b941b474ca2648f90ee57c031cffda38

The @koic change does not change anything related to 1.9.3 support, the gem-compiler issue is here since gem-compiler 0.5 release (https://github.com/luislavena/gem-compiler/blob/v0.5.0/gem-compiler.gemspec) the 21st of April 2016.

aviat commented 7 years ago

If 1.9.3 support is really a concern, shouldn't we consider putting it back in Travis?

koic commented 7 years ago

This build error aren't related to above change. I think that will be solved by PR #425 .

aviat commented 7 years ago

@koic what about rebasing on #425?

This would then allow us to add ruby-2.4.0-rc1, available according to Travis (http://rubies.travis-ci.org/).

koic commented 7 years ago

@aviat I hope that #425 will be merged to master first, then I will do rebase master at this PR afterwards. Thanks.

ignisf commented 7 years ago

Thanks, merged https://github.com/cowboyd/therubyracer/commit/f2ccbad7e9e3899e8743624d9b1436500100420a

koic commented 7 years ago

Thanks too!

aviat commented 7 years ago

Awesome thanks @ignisf @koic 🎄 🎅

rewolf commented 7 years ago

Thanks for the change! When will f2ccbad be released? Or rather, where can we see the expected next release date for the gem? Would prefer not to be linking to master in our Gemfile