Fix crash when bundle exec
'ing to bundler
#4175
Merged
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?
The problem was that
bundle exec
'ing tobundler
itself would crash if the lockfile was generated with bundler 2.1.4 and it's missing the specific platform.I can't think of any reason to
bundle exec
tobundler
, but it shouldn't be a way to make bundler crash.What is your fix for the problem, implemented in this PR?
In this case, the crash was due to
bundle exec
'ing on a definition missing the current specific platform (due to lockfile generated with older bundler). The definition would resolve gems in the main process, and then would tried to be re-resolved again inside the "bundle exec" context because of the missing platform. This double resolution would cause bundler to crash.I don't see why we should raise an exception in this situation, specially such a cryptic one, so don't raise it.
Fixes #4153.
Make sure the following tasks are checked