Skip to content

Fix resolver incorrectly filtering gems by development self-dependencies#9346

Open
sferik wants to merge 1 commit intoruby:masterfrom
sferik:fix_9319
Open

Fix resolver incorrectly filtering gems by development self-dependencies#9346
sferik wants to merge 1 commit intoruby:masterfrom
sferik:fix_9319

Conversation

@sferik
Copy link
Contributor

@sferik sferik commented Feb 23, 2026

filter_invalid_self_dependencies used s.dependencies, which returns both runtime and development dependencies for locally-installed gems (StubSpecification), but only runtime dependencies for remote gems (EndpointSpecification). This inconsistency caused the resolver to silently drop valid gem versions.

In my case, minitest-bonus-assertions 3.0 has a development dependency on itself at ~> 2.0. Since 3.0 doesn't satisfy ~> 2.0, the filter removed it entirely, making bundle update fail with "Could not find gem" even though the version exists in the index.

The fix changes s.dependencies to s.runtime_dependencies, since development dependencies are irrelevant to resolution.

`filter_invalid_self_dependencies` checked all dependencies, but should
only check runtime dependencies. Development self-dependencies are
irrelevant to resolution and should not disqualify a gem version.

Resolves ruby#9319.
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.

2 participants