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

Fix platform specific gems removed from the lockfile #6266

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Jan 11, 2023

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

If we have a lockfile missing a specific gem for the current platform, and that gem happens to be already installed locally, then Bundler will initially try to use "local mode" and use the existing lockfile exclusively. But then when materializing it will realize that it's missing platform gems and try to re-resolve to fill them in. However, since we initially used "local mode", this resolution will only consider local gems and will result in gems for other platforms being lost.

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

To fix this, we need to save the resolution mode in the definition early and make sure we set up sources using that mode before re-resolving.

Fixes #6263.

Make sure the following tasks are checked

If we have a lockfile missing platform a specific gem for the current
platform, and that gem happens to be already installed locally, then
Bundler will initially try to use "local mode" and use the existing
lockfile exclusively. But then when materializing it will realize that
it's missing platform gems and try to re-resolve to fill them in.
However, since we initially used "local mode", this resolution will only
consider local gems and will result in gems for other platforms being
lost.

To fix this, we need to save the resolution mode in the definition early
and make sure we set up sources using that mode before re-resolving.
@deivid-rodriguez deivid-rodriguez force-pushed the set-proper-resolve-mode-on-retries branch from 3e9483f to e8bd10d Compare January 13, 2023 10:54
@deivid-rodriguez deivid-rodriguez merged commit 47136c6 into master Jan 13, 2023
@deivid-rodriguez deivid-rodriguez deleted the set-proper-resolve-mode-on-retries branch January 13, 2023 14:57
deivid-rodriguez added a commit that referenced this pull request Jan 13, 2023
…ries

Fix platform specific gems removed from the lockfile

(cherry picked from commit 47136c6)
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.

Platform locked Gemfile.lock not changed correctly by bundle install
1 participant