Improve error message when current platform is not in lockfile#9439
Open
55728 wants to merge 1 commit intoruby:masterfrom
Open
Improve error message when current platform is not in lockfile#943955728 wants to merge 1 commit intoruby:masterfrom
55728 wants to merge 1 commit intoruby:masterfrom
Conversation
5627262 to
02d2179
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When
bundle installfails because the current platform is not included in the lockfile, the existing error message is confusing — it says it cannot find a gem for the locked platform, then immediately lists available gems that include the very platform it claimed to be missing.This PR adds a hint to the error message explaining the actual issue and suggesting a fix.
Fixes #9413
Example
Before:
After:
Implementation
Added a
platform_mismatch_hintmethod inBundler::Resolverthat checksBundler.locked_gems.platforms(the lockfile's PLATFORMS section) againstBundler.local_platform. When the current platform is not in the lockfile, the hint is appended to the existing error message.