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

Improve default gem handling by treating default gems as any other gem #7673

Merged

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented May 20, 2024

What was the end-user or developer problem that led to this PR?

Bundler behaves inconsistently in presence of default gems, and that can be confusing. See for example the situation in ruby/ruby#9163 (comment).

What is your fix for the problem, implemented in this PR?

My fix is that, once a default gem is specified directly in the Gemfile, or resolved as a transitive dependency, it becomes part of the bundle and gets treated as a "regular gem", so it's cached, explicitly installed in the configured location, etc.

NOTE: This is an improved version of #7242 (which had to be reverted) which fixes the issues in the initial approach and makes the change fully backwards compatible. If at bundler/setup time, default gems are found to be missing in the installed location, we will still fallback to considering them, but by default bundle install will treat them as regular gems and install them normally.

I think the new approach should also fix #4088.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/treat-default-gems-as-regular-gems branch 4 times, most recently from a672c88 to a4909e9 Compare May 20, 2024 13:53
For backwards compatibility, make sure default gems are still used as a
last resort when materializing, in case no remote, cached, or installed
specs are found.
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/treat-default-gems-as-regular-gems branch from a4909e9 to 93788f6 Compare May 29, 2024 12:43
@deivid-rodriguez deivid-rodriguez merged commit 11451bc into master May 29, 2024
83 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/treat-default-gems-as-regular-gems branch May 29, 2024 13:55
deivid-rodriguez added a commit that referenced this pull request Jun 12, 2024
…-gems-as-regular-gems

Improve default gem handling by treating default gems as any other gem

(cherry picked from commit 11451bc)
deivid-rodriguez added a commit that referenced this pull request Jun 12, 2024
…-gems-as-regular-gems

Improve default gem handling by treating default gems as any other gem

(cherry picked from commit 11451bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundler should not try to force install StubSpecifications
1 participant