Report which locked gems have no variant for the current platform - #9738
Open
Mousa96 wants to merge 1 commit into
Open
Report which locked gems have no variant for the current platform#9738Mousa96 wants to merge 1 commit into
Mousa96 wants to merge 1 commit into
Conversation
Mousa96
force-pushed
the
report-gems-with-no-variant-for-current-platform
branch
from
July 31, 2026 07:38
0201ec1 to
87017a5
Compare
Mousa96
marked this pull request as ready for review
July 31, 2026 07:38
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.
Problem
When a lockfile lists the current platform under
PLATFORMSbut one of its locked gems has novariant for that platform,
Definition#materializere-resolves the incomplete gems against theremote source. That auto-healing is deliberate, and it is announced with a debug message:
The message doesn't say which platform is current, or which gems are incomplete. Against a public
source the re-resolve succeeds and nobody notices. Against a private source the process has no
credentials for, it fails, and the default output is just
Authentication is required for <host>,which points the reader at credentials rather than at the lockfile. Re-running with
--verboseisthe natural next step, and today it only gets you halfway: you learn that some locked gem has no
variant for this platform, but not which one.
Our lockfile listed both
arm64-darwinandx86_64-linuxunderPLATFORMS, and out of roughly500 gems exactly one —
commonmarker— was locked only ascommonmarker (2.9.0-arm64-darwin).CI runs on
x86_64-linux, so that single missing variant was enough to send Bundler to thenetwork, and with 500 candidates and no name the verbose output didn't say where to look.
Before
After
With the gem named, the reader can confirm the diagnosis against
PLATFORMSin the lockfile andre-lock that one gem, instead of reproducing the heal in a non-frozen environment on the affected
platform and diffing lockfiles just to learn which gem to look at.
Scope
Message content only. The log level, the placement inside the loop, and the auto-heal behaviour are
unchanged. The two sibling conditions in the same method (
partially_missing_specs,insecurely_materialized_specs) already interpolatefull_name, so this only prints what themethod already knows. Kept at
debugto match current behaviour — happy to revisit the levelseparately if you'd prefer it louder.
The existing spec covering recovery from an incomplete lockfile (
spec/runtime/platform_spec.rb)already ran with
--verboseand asserted on this line; it now also asserts the platform and theincomplete gem, and still asserts that the install heals. The opening clause is byte-identical, so
other assertions on that substring are unaffected.
Related
#9439 improved the message for the adjacent case where the current platform is missing from
PLATFORMSentirely. This covers the case where the platform is listed but a gem's variant for itis not. #8029 added the
insecurely_materialized_specswarning referenced above.