Closed Bo98 closed 6 months ago
macos-latest
failure on Ruby 2.5 is expected since macos-latest
now points to an arm64 runner: https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/.
Only Ruby >= 2.6 is supported there: https://github.com/ruby/setup-ruby/commit/e8677f0f3922a9e00e6238630ba7742af68b6ee8
Hi @Bo98—thanks for opening this!
If I understand correctly, base64
will still be bundled with Ruby in 3.4—though not as a default gem. I'm a bit sad to see code getting more confusing (ie, what does unpack1("m0")
mean?) in order to remove a gem dependency that ships with Ruby. Do you know of any discussion around bundled gem use in libraries? Are library authors meant to avoid using them?
This is a pretty small change, though, so I'm ok merging it if it makes it easier to use the library.
Thanks for looking into that Ruby 2.5 failure—I'll clean that up as part of https://github.com/davishmcclurg/json_schemer/issues/178.
If I understand correctly,
base64
will still be bundled with Ruby in 3.4—though not as a default gem. I'm a bit sad to see code getting more confusing (ie, what doesunpack1("m0")
mean?) in order to remove a gem dependency that ships with Ruby. Do you know of any discussion around bundled gem use in libraries? Are library authors meant to avoid using them?
Bundled gems are competely ignored with Bundler so the behaviour from Ruby 3.4 is it will be that base64
will be a dependency that is always downloaded from RubyGems. This already happens in some cases on 3.3 and earlier if the default gem doesn't exactly match the latest version of base64
hosted on RubyGems.
I'm OK to close this though if you prefer the extra dependency for readability.
Bundled gems are competely ignored with Bundler so the behaviour from Ruby 3.4 is it will be that
base64
will be a dependency that is always downloaded from RubyGems. This already happens in some cases on 3.3 and earlier if the default gem doesn't exactly match the latest version ofbase64
hosted on RubyGems.
Oh I didn't realize that—thanks for the clarification.
I'm OK to close this though if you prefer the extra dependency for readability.
No, I think this is good if bundler treats it as a regular dependency. I'll merge. Thanks for the contribution!
This has been released in 2.3.0.
This follows a common practice that's been adopted by the majority of the Ruby community: https://github.com/rubocop/rubocop/commit/b2b29da6406ed55fe42fe045435c29bed6635299, https://github.com/rack/rack/commit/696ed9e8f48053683a0a19fc68eb49f094c0efcb, https://github.com/lostisland/faraday/commit/9487833b426ad1c50d6d8a29d82601202a528c56, https://github.com/octokit/octokit.rb/commit/a787bf47377229688eea4b6c78b26b584f65595b.
The personal reason for my need for this is that
bootsnap
doesn't seem to work properly on Ruby < 3.4 when usingbase64
, which is preventing me from usingjson_schemer
2.2.x:This is technically a Bundler/Bootsnap problem, but I felt it was worthwhile reducing the dependency tree here anyway.