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

Bump Ruby from 3.3.6 to 3.4.0 #11162

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Bump Ruby from 3.3.6 to 3.4.0 #11162

wants to merge 1 commit into from

Conversation

JamieMagee
Copy link
Contributor

@JamieMagee JamieMagee commented Dec 20, 2024

What are you trying to accomplish?

Prepare for the Ruby 3.4.0 release on 25th December.

Anything you want to highlight for special attention from reviewers?

New warnings

After this upgrade there are a couple of new warnings printed in the console:

/home/jamie/.local/share/mise/installs/ruby/3.4.0-rc1/lib/ruby/gems/3.4.0+1/gems/json-2.6.3/lib/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
/home/jamie/.local/share/mise/installs/ruby/3.4.0-rc1/lib/ruby/gems/3.4.0+1/gems/excon-0.110.0/lib/excon.rb:41: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
/home/jamie/.local/share/mise/installs/ruby/3.4.0-rc1/lib/ruby/gems/3.4.0+1/gems/reline-0.5.2/lib/reline.rb:9: warning: fiddle was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add fiddle to your Gemfile or gemspec to silence this warning

Removing require "set"

After updating the target rubocop ruby version from 3.1 to 3.4 I was able to remove require "set", as the set module has been loaded by default since Ruby 3.2.01.

Set is now available as a builtin class without the need for require "set"

Updating ruby/ruby-setup

Support for Ruby 3.4.0-rc1 was only added in ruby/[email protected]: ruby/setup-ruby#675

Adding require "ostruct"

See #11163

RFC3986 URI parser is now the default

Previously, the RFC2396 was the default, but it was changed to RFC38962. We were using the ABS_URI regex, but the make_regex with RFC3896 has equivalent behaviour.

The RFC3986 parser also throws a slightly different error message for InvalidURIError.

irb(main):001> "https://example.com".match?(URI::RFC2396_PARSER.regexp[:ABS_URI])
=> true
irb(main):002> "//example.com".match?(URI::RFC2396_PARSER.regexp[:ABS_URI])
=> false
irb(main):003> "example.com".match?(URI::RFC2396_PARSER.regexp[:ABS_URI])
=> false
irb(main):012> "https://example.com".match?(URI::RFC3986_PARSER.make_regexp)
=> true
irb(main):013> "//example.com".match?(URI::RFC3986_PARSER.make_regexp)
=> false
irb(main):014> "example.com".match?(URI::RFC3986_PARSER.make_regexp)
=> false

How will you know you've accomplished your goal?

All tests pass

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

Footnotes

  1. https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/

  2. https://github.com/ruby/uri/pull/107

@github-actions github-actions bot added L: ruby:bundler RubyGems via bundler L: dotnet:nuget NuGet packages via nuget or dotnet L: javascript labels Dec 20, 2024
@JamieMagee JamieMagee removed L: dotnet:nuget NuGet packages via nuget or dotnet L: javascript labels Dec 20, 2024
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from be20242 to 3cf14b8 Compare December 20, 2024 03:29
@github-actions github-actions bot added L: dotnet:nuget NuGet packages via nuget or dotnet L: javascript labels Dec 20, 2024
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from 3cf14b8 to aeb9baa Compare December 20, 2024 03:44
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from aeb9baa to 3a85a9f Compare December 20, 2024 04:10
@github-actions github-actions bot added the L: php:composer Issues and code for Composer label Dec 20, 2024
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from 3a85a9f to 64b18f2 Compare December 20, 2024 04:16
@github-actions github-actions bot added the L: java:maven Maven packages via Maven label Dec 20, 2024
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from 64b18f2 to 316994c Compare December 20, 2024 04:49
@@ -174,7 +174,7 @@ def self.invalid_v2_requirement?(composer_json)

sig { params(dependency_url: String).returns(String) }
def self.clean_dependency_url(dependency_url)
return dependency_url unless URI::DEFAULT_PARSER.regexp[:ABS_URI].match?(dependency_url)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure why URI::RFC_3986.make_regexp.match?(dependency_url) doesn't give the same results for this specific instance. But using RFC2396_PARSER explicitly works for now.

@JamieMagee JamieMagee marked this pull request as ready for review December 20, 2024 05:22
@JamieMagee JamieMagee requested review from a team as code owners December 20, 2024 05:22
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
nokogiri (1.17.2)
mini_portile2 (~> 2.8.2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already 1.18.0.rc1 which already supports platform specific versions in Ruby 3.4. I suspect final version will be released very soon.

Copy link
Contributor Author

@JamieMagee JamieMagee Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let me upgrade to 1.18.0.rc1 for now, then we can bump to 1.18.0 once it's released.

EDIT: It's not worth the hassle. Just going to leave it as-is for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, it should work the same, just take longer to install.

@deivid-rodriguez
Copy link
Contributor

/home/jamie/.local/share/mise/installs/ruby/3.4.0-rc1/lib/ruby/gems/3.4.0+1/gems/json-2.6.3/lib/json/common.rb:3: warning: ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add ostruct to your Gemfile or gemspec to silence this warning.
/home/jamie/.local/share/mise/installs/ruby/3.4.0-rc1/lib/ruby/gems/3.4.0+1/gems/excon-0.110.0/lib/excon.rb:41: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
/home/jamie/.local/share/mise/installs/ruby/3.4.0-rc1/lib/ruby/gems/3.4.0+1/gems/reline-0.5.2/lib/reline.rb:9: warning: fiddle was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add fiddle to your Gemfile or gemspec to silence this warning

@JamieMagee Did you find warning locations all messed up or is it just me? I'm trying to get Ruby print the code locations that I was expecting at ruby/ruby#12412.

@JamieMagee
Copy link
Contributor Author

@JamieMagee Did you find warning locations all messed up or is it just me? I'm trying to get Ruby print the code locations that I was expecting at ruby/ruby#12412.

I didn't actually check the exact locations. The gem name was enough for me to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet L: java:maven Maven packages via Maven L: javascript L: php:composer Issues and code for Composer L: python L: ruby:bundler RubyGems via bundler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants