Skip to content

Conversation

@JamieMagee
Copy link
Member

@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/ruby-setup@1.204.0: 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

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
Member 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!

Gemfile.lock Outdated
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
Member 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
Member 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.

@jeffwidman
Copy link
Member

Dec 25th 🎄 has come and gone, want to update now that 3.4.0 is out of release candidate?

@JamieMagee
Copy link
Member Author

@jeffwidman I'm still on vacation. I can tackle this when I'm back, or feel free to update it before then.

I wanted to do the hard work while I had some free time before the holidays. The final step should be very simple.

@landongrindheim
Copy link
Contributor

I think we'll want to go straight to Ruby 3.4.1

brettfo
brettfo previously approved these changes Jan 8, 2025
@edouard
Copy link

edouard commented Jan 14, 2025

Can you merge this so we can use dependabot on projects requiring ruby 3.4?

@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch 2 times, most recently from 0aee2a1 to 3220161 Compare February 3, 2025 21:23
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch 3 times, most recently from 46e7619 to 50cc449 Compare February 4, 2025 05:02
@JamieMagee
Copy link
Member Author

Updated to Ruby 3.4.1. The smoke test failures appear unrelated, as all other PRs are failing on the same tests.

@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch 5 times, most recently from 9774574 to 1ebcd42 Compare February 10, 2025 18:59
@nickjer
Copy link

nickjer commented Feb 13, 2025

Hoping this can be merged soon as dependabot has been failing for weeks now on a project with Ruby 3.4 requirements.

@nickjer
Copy link

nickjer commented Feb 24, 2025

Looks like this now can be updated to Ruby 3.4.2.

@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from 1ebcd42 to f4c6146 Compare February 24, 2025 17:11
@JamieMagee JamieMagee changed the title Bump Ruby from 3.3.6 to 3.4.0 Bump Ruby from 3.3.6 to 3.4.2 Feb 24, 2025
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from f4c6146 to df37f14 Compare February 24, 2025 17:12
@JamieMagee JamieMagee force-pushed the jamiemagee/ruby-3.4.0 branch from df37f14 to ce5bad5 Compare February 24, 2025 17:15
@JamieMagee
Copy link
Member Author

I've reabsed this on top of Ruby 3.4.2. There are a couple of test failures that still need to be addressed before merge, but not many.

@schinery
Copy link
Contributor

Any news on this getting resolved/merged?

@JamieMagee
Copy link
Member Author

@schinery I'm closing this in favour of #11681. @chrisyuska is very close to getting it merged.

@JamieMagee JamieMagee closed this Mar 24, 2025
@JamieMagee JamieMagee deleted the jamiemagee/ruby-3.4.0 branch April 21, 2025 16:07
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.

9 participants