-
Notifications
You must be signed in to change notification settings - Fork 98
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
Declare explicit dependency on benchmark
#141
Conversation
Ruby plans to bundle it: ruby/ruby#11492 That means, in the next ruby version requiring it without it appearing in the gemspec will warn, and the release after that will error.
Ruby plans to make `benchmark` a bundled gem: ruby/ruby#11492 It doesn't make much sense to continue this core extension since rails would need to add it to its gemspec to continue offering it for what basically amounts to `x * 1000`. Since requiring it could emit a warning, add it to the gemspec until it can later be removed again with Rails 8.1 The benchmark generator will continue to work as usual: It adds `benchmark-ips` to the users Gemfile, which in turn should depend on `benchmark`: evanphx/benchmark-ips#141
I think it would be good to wait that that PR is merged at least to merge this one. |
Of course, there is no rush |
Will this break current users though? |
@@ -41,4 +41,5 @@ Gem::Specification.new do |s| | |||
s.add_dependency(%q<minitest>, ["~> 5.4"]) | |||
s.add_dependency(%q<rdoc>, ["~> 4.0"]) | |||
end | |||
s.add_dependency(%q<benchmark>, ["~> 0.1"]) |
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.
s.add_dependency(%q<benchmark>, ["~> 0.1"]) | |
s.add_dependency(%q<benchmark>, ["> 0.1"]) |
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.
No reason to stay on a 0. release forever.
If they don't update benchmark-ips for about two years but keep up with ruby, yes. I don't imagine any other breakage as a result of this change. Both ips and benchmark make no restrictions about their supported ruby version and adding past bundled gems to the gemspec of other gems has mostly been painless. I'll come back to this later and address your PR feedback when/if the ruby PR ends up merged. Eregon has made a comment there which may have an impact. |
benchmark doesn't test older than 2.5: https://github.com/ruby/benchmark/blob/master/.github/workflows/test.yml FWIW Process.clock_gettime exists since Ruby 2.1 (current |
Seems likenit's missing a For what's its worth, I agree with your points. There are barely any changes to it in the last decade and I made the same point about javascript somewhere else when the same thing happened with It's a bit sad that what basically amounts to syntactical sugar requires a dependeny. But when it comes down to it, I prefer my 50% of my downstream dependencies not having these. Same can be said for This all doesn't apply to gems with what I would call actual functionality, like |
@Earlopain Maybe you could post your opinion on https://bugs.ruby-lang.org/issues/20309 too? |
Interacting in the bugtracker is daunting for me. I wrote a thing there, hopefully that's adequate. |
Seems like they will go on with bundling benchmark. I openend ruby/benchmark#24 for the missing I looked through the code here, and I'm wondering if there even is any dependency on benchmark-ips/lib/benchmark/timing.rb Line 44 in a2c863d
Process.clock_gettime without relying on benchmark .
This gem advertises itself as an extension to I guess, if that is the case, I can just close this? |
Right, seems there is no dependency so it shouldn't warn and this can be closed then. |
I played around with this last night and tried undefining benchmark at various points, etc. There's no actual dependency AFAICT 😆 |
Yes, I appologise. It didn't compute that there may be no dependency here and I didn't check. Thanks for the conversation anyways |
Ruby plans to bundle it: ruby/ruby#11492
That means, in the next ruby version requiring it without it appearing in the gemspec will warn, and the release after that will error.