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

Ad-hoc fix for platform regression #4127

Merged
merged 1 commit into from Dec 14, 2020

Conversation

deivid-rodriguez
Copy link
Member

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

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

In bundler 2.2 we switched to a "strict platform materialization". That means that the exact resolution, including the platform specific gems resolved for each specific platform, and the specific platforms themselves are now recorded in the lockfile.

Previously, the resolution was done without considering platform specific variants at all, and then at install time, a platform specific version for the resolved version would be installed if it happens to exist.

With the fixed behaviour though, if we are materializing a lock file created with an old bundler version, the new bundler version will interpret that the pure ruby version was resolved (since that's what it finds in the lock file) and try to materialize that. However, that version doesn't really exist in the system (it's the platform specific variant that got installed).

This change should restore backwards compatibility in this regard.

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

My fix is to check the version of bundler present in the lock file (if it exists), which indicates the version of bundler that created it. If that version is prior to 2.2.0, we fallback to the old behaviour.

We should be able to remove this once we have proper bundler version switching.

Fixes #4123.
Fixes #4122 too, I think.

Make sure the following tasks are checked

Copy link
Member

@hsbt hsbt left a comment

Choose a reason for hiding this comment

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

👍

@deivid-rodriguez
Copy link
Member Author

Unfortunately all regressions in 2.2.0 have been caused by #4015, so I'm considering full revert of that as an alternative to this PR, since I don't currently have a solution for #4128. So let me investigate a bit more this weekend and we can release patch level versions on Monday with either approach. Does that sound good?

@deivid-rodriguez
Copy link
Member Author

After countless hours I think I managed to figure #4128 out, so we shouldn't need to revert #4015 💪.

@deivid-rodriguez deivid-rodriguez marked this pull request as draft December 13, 2020 06:19
@deivid-rodriguez deivid-rodriguez force-pushed the specific_platform_regression branch 2 times, most recently from ac6efa2 to 467c43a Compare December 13, 2020 18:29
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review December 13, 2020 19:44
We should be able to remove this once we have proper bundler version
switching.
@deivid-rodriguez deivid-rodriguez merged commit 6a8791c into master Dec 14, 2020
@deivid-rodriguez deivid-rodriguez deleted the specific_platform_regression branch December 14, 2020 11:52
deivid-rodriguez added a commit that referenced this pull request Dec 14, 2020
Ad-hoc fix for platform regression

(cherry picked from commit 6a8791c)
mokagio added a commit to Automattic/simplenote-ios that referenced this pull request Dec 16, 2020
2.2.1 has a fix for some platform specific stuff which seems worth
adopting ASAP: rubygems/rubygems#4127
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 does not find platform specific gem bundle install does not respect lock file
4 participants