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

Add ostruct dependency to fix warning on Ruby 3.3.5+ #542

Merged
merged 2 commits into from
Sep 5, 2024
Merged

Conversation

mattbrictson
Copy link
Member

@mattbrictson mattbrictson commented Sep 5, 2024

Fixes the following warning on Ruby 3.3.5+ and Ruby 3.4:

sshkit-1.23.0/lib/sshkit.rb:29: 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.

Closes #541

@mattbrictson mattbrictson added the 🏠 Housekeeping Non-user facing cleanup and maintenance label Sep 5, 2024
@mattbrictson mattbrictson changed the title Add ostruct dependency to fix warnings on Ruby 3.3.5+ Add ostruct dependency to fix warning on Ruby 3.3.5+ Sep 5, 2024
@tisba
Copy link
Contributor

tisba commented Sep 5, 2024

I also get (sshkit 1.23.0):

/.gem/ruby/3.3.5/gems/sshkit-1.23.0/lib/sshkit.rb:29: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.

There was an overview what is planned to change in terms of stdlib/bundled gems in upcoming Ruby versions, but I cannot find it :(

@mattbrictson
Copy link
Member Author

@tisba what version of net-ssh are you using? The only place I can find where sshkit is doing require 'logger' is in this conditional branch, which should only run for very old versions of net-ssh (< 4.0.0):

# net-ssh < 4.0.0 doesn't have assign_defaults
unless @default_options.key?(:logger)
require 'logger'
@default_options[:logger] = ::Logger.new(STDERR)
@default_options[:logger].level = ::Logger::FATAL
end

@tisba
Copy link
Contributor

tisba commented Sep 5, 2024

net-ssh (7.2.3)

But sorry for the noise, I'm pretty sure it's net-ssh's fault. They don't have the logger gem as a dependency.

@mattbrictson
Copy link
Member Author

There was an overview what is planned to change in terms of stdlib/bundled gems in upcoming Ruby versions, but I cannot find it

As of Ruby 3.3.5, here is the list of gems that will no longer be built into future Ruby versions: https://github.com/ruby/ruby/blob/ef084cc8f4958c1b6e4ead99136631bef6d8ddba/lib/bundled_gems.rb#L5-L35

E.g.

"ostruct" => "3.5.0",

means that ostruct will be removed in Ruby 3.5.0, which is what produces this warning:

ostruct was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0

@mattbrictson mattbrictson merged commit 91375af into master Sep 5, 2024
19 checks passed
@mattbrictson mattbrictson deleted the ostruct branch September 5, 2024 20:50
@dorianmariecom
Copy link

dorianmariecom commented Sep 6, 2024

Can a new version be released? :) plz thx

@tisba
Copy link
Contributor

tisba commented Sep 6, 2024

Already has been released as 1.23.1, see https://rubygems.org/gems/sshkit/versions/1.23.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏠 Housekeeping Non-user facing cleanup and maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

warning: ostruct was loaded from the standard library
3 participants