Skip to content

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

Merged
mattbrictson merged 2 commits into
masterfrom
ostruct
Sep 5, 2024
Merged

Add ostruct dependency to fix warning on Ruby 3.3.5+#542
mattbrictson merged 2 commits into
masterfrom
ostruct

Conversation

@mattbrictson

@mattbrictson mattbrictson commented Sep 5, 2024

Copy link
Copy Markdown
Member

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

tisba commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

tisba commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
@mattbrictson
mattbrictson deleted the ostruct branch September 5, 2024 20:50
@dorianmariecom

dorianmariecom commented Sep 6, 2024

Copy link
Copy Markdown

Can a new version be released? :) plz thx

@tisba

tisba commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

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