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 bundler installing gems for a different platform when running in frozen mode and current platform not in the lockfile #4172

Merged
merged 3 commits into from
Dec 21, 2020

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Dec 17, 2020

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

Since bundler 2.2.1, bundler could end up installing dependencies not valid for the current platform.

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

RUBY is no longer included as a platform in the lockfile, however it's still included in the list of rubygems platforms, so the check was not doing the right thing.

Instead, use our own logic.

Fixes #4166.

Make sure the following tasks are checked

RUBY is no longer included as a platform in the lockfile, however it's
still included in the list of rubygems platforms, so the check was not
doing the right thing.

Instead, use our own logic.
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review December 17, 2020 16:57
@deivid-rodriguez deivid-rodriguez changed the title Fix platform validation Fix bundler installing gems for a different platform when running in frozen mode and current platform not in the lockfile Dec 17, 2020
@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Dec 18, 2020

I noticed that this error can only happen in frozen mode, so I think it'd be worth mentioning that as the cause of the error. I'll push an update.

However, I'm not sure about remediation steps. It's somewhat tricky because bundle lock --add-platform x86_64-linux is not going to work in frozen mode (I wonder if a command explicitly meant to update the lockfile should override frozen mode, but that's another story). So we'll need to mention that the command needs to be run in a non frozen environment, or maybe mention bundle config unset frozen && bundle lock --add-platform x86_84-linux && bundle config set --local frozen true directly?

Any ideas, @indirect, @knu?

@deivid-rodriguez
Copy link
Member Author

I'll merge this now, and we can further tweak it later.

@deivid-rodriguez deivid-rodriguez merged commit cbc5c0c into master Dec 21, 2020
@deivid-rodriguez deivid-rodriguez deleted the frozen_mode_and_external_platform branch December 21, 2020 09:27
deivid-rodriguez added a commit that referenced this pull request Dec 22, 2020
Fix bundler installing gems for a different platform when running in frozen mode and current platform not in the lockfile

(cherry picked from commit cbc5c0c)
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 2.2.1, multiple platforms and bundle install --frozen
4 participants