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

Support Bundler 2.6.1 #2129

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

deivid-rodriguez
Copy link

@deivid-rodriguez deivid-rodriguez commented Dec 18, 2024

Motivation

Bundler 2.6 has just been released and unfortunately I noticed that it does not play well with tapioca.

Implementation

The main incompatibility I noticed was introduced at rubygems/rubygems#8251.

In that PR, missing specs were moved from the spec set of materialized specifications to the spec set holding the original resolution.

Unfortunately, that's necessary to fix the issue I wanted to solve, and I'm not sure how to fix the original issue while making the change backwards compatible with what tapioca was doing here. So I'm trying to change tapioca instead to play nice with Bundler 2.6.

I also found another test only incompatibility introduced by rubygems/rubygems#8165 in Bundler 2.5.23. That's because Gem::Specification.stubs would hold a Bundler::SpecSet before that PR (similar to a hash) while after the PR it was change to hold an array of specs (the same thing it holds when bundler/setup has not been loaded). Since this only affects specs, I changed the specs to play nice with that change as well.

Tests

My hope is to run CI with the latest Bundler and get tests green.

I'm also planning to introduce a basic tapioca CLI check to Bundler's CI so that I can detect this issue in advance in the future.

Gem::Specification.stubs used to be a `Bundler::SpecSet` when
`bundler/setup` has been required. However, that was unintentional and
was reverted to be a plain array of specs like with standard RubyGems in
Bundler 2.5.23.

This change make specs support that change.
RubyGems 3.5.x ships with Bundler 2.5.x, so it's unnecessary.
In CI, we bump to RubyGems 3.5.23 which ships with Bundler 2.5.23.
Bundler 2.6 made a change where missing_specs are now kept in the
original resolve spec set, not in the spec set with materialized
specifications.

This change adapts tapioca to that.
Copy link
Contributor

@KaanOzkan KaanOzkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Opened sorbet/sorbet#8394 to resolve the type checking error.

@@ -45,6 +45,9 @@ jobs:
experimental: true
- ruby: "head"
experimental: true
- rails: "current"
ruby: "3.3"
rubygems: "3.5.23"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, any particular reason you picked Ruby 3.3 for this?

Copy link
Author

@deivid-rodriguez deivid-rodriguez Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really. I wanted to keep at least one job running with older Bundler, and I chose the latest released Ruby but there was no particular reason, we could also choose the oldest supported Ruby, for example.

@deivid-rodriguez
Copy link
Author

I'm also adding a basic tapioca check to our CI: rubygems/rubygems#8346.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants