Skip to content
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

Better: Add ruby 3.1 compatibility. #279

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

ylecuyer
Copy link
Contributor

In https://github.com/ylecuyer/puma-status I had a red build because timecop isn't yet compatible with ruby 3.1

Run bundle exec rspec
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:44: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
TypeError: no implicit conversion of Hash into Integer
bundler: failed to load command: rspec (/home/runner/.rubies/ruby-head/bin/rspec)
  <internal:timev>:123:in `initialize'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/timecop-0.9.1/lib/timecop/time_extensions.rb:22:in `new'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/timecop-0.9.1/lib/timecop/time_extensions.rb:22:in `new_with_mock_time'
  <internal:timev>:10:in `now'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:89:in `start'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/lib/rspec/core/reporter.rb:72:in `report'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:115:in `run_specs'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:89:in `run'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:71:in `run'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/lib/rspec/core/runner.rb:45:in `invoke'
  /home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rspec-core-3.9.1/exe/rspec:4:in `<top (required)>'
  /home/runner/.rubies/ruby-head/bin/rspec:23:in `load'
  /home/runner/.rubies/ruby-head/bin/rspec:23:in `<top (required)>'
Error: Process completed with exit code 1.

This is because of this new change in ruby 3.1: https://bugs.ruby-lang.org/issues/17485

This PR adds the support for it

@jwillemsen
Copy link
Contributor

#276 also has a fix for ruby 3.1

@ylecuyer
Copy link
Contributor Author

ylecuyer commented Feb 7, 2021

#276 also has a fix for ruby 3.1

Indeed, however ruby2_keyword is a temporary method devs can use until they get the code compatible and I read it will be deprecated and removed in future ruby version https://github.com/ruby/ruby/blob/master/vm_method.c#L2145

@jwillemsen
Copy link
Contributor

pvoutput uses this gem, also has this ruby 3.1 problem, see johnf/pvoutput#22

@joshuacronemeyer
Copy link
Collaborator

@ylecuyer I like having a fix that we won't have to worry about down the road, but I think this change has an infinite loop on ruby-head.

koic added a commit to koic/faker that referenced this pull request Feb 9, 2021
Workaround for faker-ruby#2260.

This PR suspends ruby-head CI until travisjeffery/timecop#279 is resolved.

GitHub Actions doesn't seem to have a mechanism like Travis CI's allow-failure yet.
https://github.com/actions/toolkit/issues/399
koic added a commit to koic/faker that referenced this pull request Feb 9, 2021
Workaround for faker-ruby#2260.

This PR suspends ruby-head CI until travisjeffery/timecop#279 is resolved.

GitHub Actions doesn't seem to have a mechanism like Travis CI's `allow_failures` yet.
https://github.com/actions/toolkit/issues/399
koic added a commit to koic/faker that referenced this pull request Feb 9, 2021
Fixes faker-ruby#2260.

This PR suspends ruby-head CI until travisjeffery/timecop#279 is resolved.

GitHub Actions doesn't seem to have a mechanism like Travis CI's `allow_failures` yet.
https://github.com/actions/toolkit/issues/399
@joshuacronemeyer
Copy link
Collaborator

Looks like the build is failing for 1.9.3

I merged another PR for ruby 3.1 support that is going into our 0.9.4 release. I still like the idea of this one since it doesn't use a method that will be removed in ruby 3.2 (maybe), but wanted to get things working for people. Feel free to get this approach working. We can revisit it.

fcolacilli pushed a commit to fcolacilli/faker that referenced this pull request Feb 11, 2021
Fixes faker-ruby#2260.

This PR suspends ruby-head CI until travisjeffery/timecop#279 is resolved.

GitHub Actions doesn't seem to have a mechanism like Travis CI's `allow_failures` yet.
https://github.com/actions/toolkit/issues/399
@ramonskie ramonskie mentioned this pull request Jan 14, 2022
@voxik
Copy link

voxik commented Jan 18, 2022

While this was workaround in #288, I think this is superior fix.

@joshuacronemeyer joshuacronemeyer merged commit e3b4c9f into travisjeffery:master Aug 10, 2023
@joshuacronemeyer
Copy link
Collaborator

I tried merging this but the build fails for ruby 3.1 I have reverted it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants