-
-
Notifications
You must be signed in to change notification settings - Fork 328
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 'fiddle' gem as a runtime dependency #852
base: master
Are you sure you want to change the base?
Add 'fiddle' gem as a runtime dependency #852
Conversation
Fixes deivid-rodriguez#851 The following warning is printed to stderr when using byebug on Ruby 3.3.5: > /home/david/.rbenv/versions/3.3.5/lib/ruby/3.3.0/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. This change aims to cause that warning no longer to appear, by implementing one of the suggestions in the warning message, i.e. by adding the `fiddle` gem to byebug's gemspec as a runtime dependency.
Here's the reproduction script from issue #851, but modified to use this branch, rather than the # File: run-byebug-from-inline-gemfile.rb
# Run with: `ruby run-byebug-from-inline-gemfile.rb`
require 'bundler/inline'
gemfile do
ruby '3.3.5'
source 'https://rubygems.org'
gem 'byebug', github: 'davidrunger/byebug', ref: '731e9dc15eee40bde99f46c12c68c32f09f0d806'
end
puts("Ruby version: #{RUBY_VERSION}")
require 'byebug/version'
puts("Byebug version: #{Byebug::VERSION}")
require 'fiddle/version'
puts("Fiddle version: #{Fiddle::VERSION}")
byebug When executed, that modified version of the script does not print the warning about
|
@@ -25,5 +25,7 @@ Gem::Specification.new do |s| | |||
s.extensions = ["ext/byebug/extconf.rb"] | |||
s.require_path = "lib" | |||
|
|||
s.add_dependency "fiddle", "~> 1.0" |
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.
It definitely feels kind of sad to be taking byebug
from being a dependency-free gem to now having a runtime dependency, but I guess that unfortunately that might sort of be the inevitable result of Ruby moving more and more of its non-core functionality out of the standard library and into gems.
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.
I wasn't sure which version specifier to put here. I went with ~> 1.0
because:
fiddle
v1.0.0 was released quite a while ago, on 2017-12-06 (source).- That ensures that we will require the latest
fiddle
major version (i.e. version 1) and that we won't pull in any subsequent major version (e.g. version 2) that might include breaking changes.
Caveat ❗This PR should probably only be merged if (Unfortunately, I personally have no idea whether or not that is the case.) If |
This warning is comming from the On the other hand, |
@Earlopain Thank you for all of those helpful pointers/links!
FWIW, I think that this is not technically quite true. At least, in my reproduction script, I think that If I add this content to the script: require 'reline/version'
puts("Reline version: #{Reline::VERSION}")
puts("Reline version source: #{Reline.const_source_location(:VERSION)}") Then it prints this:
which seems to reference a path in the Ruby 3.3.5 standard library. If I add to the gem 'reline' then this gets printed: Reline version: 0.5.10
Reline version source: ["/home/david/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/reline-0.5.10/lib/reline/version.rb", 2] In that case, we can see that the path is from the gem version of Maybe this little detail doesn't matter much, but I mention it for clarity, and in case it does somehow matter.
That's very helpful info. I guess maybe it's acceptable, if 3.3.5 is the only Ruby version that will see these warnings? Maybe just close this PR and take no action to try to suppress that warning on Ruby 3.3.5? Maybe it's worth mentioning that a number of my projects that use While pulling in the |
It is using the standard library version, yes. In ruby 3.3.5 some warnings were backported, but the standard library versions did not get appropriately updated, which means ruby's own standard library is now emitting these warnings. It is rather unfortunate, Even in the standard library I would still call it a gem, but the semantics don't really matter.
I'd love for ruby to release 3.3.6 right now but I doubt this is going to happen. There was no release when 3.3.3 broke
Yes, if even just one direct/transient dependency pulls it in, the warnings will not show. I don't find it optimal but it is the way it is, and to be fair it has worked rather ok for now with previous warnings. You just need one person to alert the library author.
That's correct, yes. I would think if any functionality actually relies on it, then |
Fixes #851
The following warning is printed to stderr when using byebug on Ruby 3.3.5:
This change aims to cause that warning no longer to appear, by implementing one of the suggestions in the warning message, i.e. by adding the
fiddle
gem to byebug's gemspec as a runtime dependency.