-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-12029) Prepare for Ruby 3.3 #9398
Conversation
Running puppet with Ruby 3.3.0 prints: $ bundle exec puppet --version /home/josh/work/puppet/lib/puppet/settings.rb:4: warning: getoptlong was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add getoptlong to your Gemfile or gemspec. /home/josh/work/puppet/lib/puppet/util/feature.rb:116: warning: syslog was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add syslog to your Gemfile or gemspec. Since getoptlong is necessary to parse the command line and is a pure ruby gem, it's safe to add it as a runtime dependency in puppet.gemspec. Since syslog is a feature and requires native extensions, add it to the features group in the Gemfile (excluding Windows and JRuby). It will also need to be added to the runtime on non-Windows platforms. The versions were chosen to match what is currently shipped in ruby 3.2.4, but updates to the patch component are allowed.
Ruby 3.3 changed NoMethodError message format so it no longer calls to_s on our Interface, see ruby commit 1fd181b453a
Single quote dependency names and sort them for maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do we have a follow up ticket to add syslog to the runtime?
Related to the comment above, I'm getting this warning while running puppet 8.8.1 with ruby 3.3.0, on every spec test:
I thought I'd drop a comment here and not open a new issue just for this, as it's not a big deal. |
Turns out this is not true. syslog is still a bundled gem in 3.4 (see https://github.com/ruby/ruby/blob/9d69619623ec6b86c464b7cac911b7201f74dab7/gems/bundled_gems#L35), so we can be certain that the gem can be required. It's only when a gem is no longer default or bundled (like scanf) that it needs to be added to the runtime. |
Running puppet with Ruby 3.3.0 prints:
Since getoptlong is necessary to parse the command line and is a pure ruby gem,
it's safe to add it as a runtime dependency in puppet.gemspec.
Since syslog is a feature and requires native extensions, add it to the features
group in the Gemfile. It will also need to be added to the runtime on
non-Windows platforms.
The versions were chosen to match what is currently shipped in ruby 3.2.4, but
updates to the patch component are allowed.
Fixes #9209