Fix platform specific gems being removed from the lockfile #4580
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the end-user or developer problem that led to this PR?
Sometimes bundler is removing some gems from the lockfile that it shouldn't be removing.
What is your fix for the problem, implemented in this PR?
My fix is to revert 1f7797a in favour of another approach to fix the same issue.
Originally the approach being removed here was implemented so that we could get rid of this platform filtering pass, which would have the effect of fixing a performance regression: #4275.
However, removing this platform filtering pass is not really necessary to improve the performance. All that it needs to be done is to move the platform filtering pass to be inside the resolver so that it's only run when we actually resolve, not for every usage of a bundle.
By restoring it at the right place, this issue should be gone without reintroducing any past issues.
Fixes #4516.
Make sure the following tasks are checked