Repository navigation
Conversation
|
@sferik Thanks. In my understanding, the current behavior use |
`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.
|
@hsbt No, |
|
That's IMHO invalid gem actually. What about to make specification policy warning about this (or even failure) so it is reported during build time it will result in broken gem and fix on gem side over band-aiding in RubyGems itself? What if the same would be in runtime dependencies, how the fix would work? |
|
@sferik Could you report this to minitest-bonus-assertions? BTW, why does minitest-bonus-assertions have itself as a development dependency...? |
|
I agree that this probably should’ve been rejected at built time, but it wasn’t—this gem made it into the wild and now is causing real issues. I can work on a I believe this patch would fix this issue and would also make the Bundler resolver marginally faster. Any reason not to accept it? |
I can provide the batch to be more strict in build time. Have you tried to contact the author of the gem? I have not found any try on tracker, so I tried on my own - halostatue/minitest-bonus-assertions#3. Sadly that happens from time to time that broken gem is published. I have tried to build the gem and it raises the warning already today. Would fixed release fix your original issue?
It is bandaid. Everything works as intended, the gem is actually wrong. That's the reason. |
- ### Problem A gem that has a self-reference in its dependencies would previously get a warning during `gem build`, saying it's "discouradged". A gem that includes a self-reference can't be updated due to bundler filtering it out. https://github.com/ruby/rubygems/blob/6fd37f4afeb3943cf508d1394fcf4338a1266f2e/bundler/lib/bundler/resolver.rb#L405-L410 I think we should be more strict and prevent the gem from building. ### Solution Raise an explicit error. This codepath is only hit when running `gem build`, so this change won't affect existing consumers of those gems (it was previously possible to install those gems, but not update them, see ruby#9346 for more context).
…ference: - ### Problem A gem that has a self-reference in its dependencies would previously get a warning during `gem build`, saying it's "discouradged". A gem that includes a self-reference can't be updated due to bundler filtering it out. https://github.com/ruby/rubygems/blob/6fd37f4afeb3943cf508d1394fcf4338a1266f2e/bundler/lib/bundler/resolver.rb#L405-L410 I think we should be more strict and prevent the gem from building. ### Solution Raise an explicit error. This codepath is only hit when running `gem build`, so this change won't affect existing consumers of those gems (it was previously possible to install those gems, but not update them, see ruby/rubygems#9346 for more context). ruby/rubygems@fa4673953a
filter_invalid_self_dependenciesuseds.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-assertions3.0 has a development dependency on itself at ~> 2.0. Since 3.0 doesn't satisfy ~> 2.0, the filter removed it entirely, makingbundle updatefail with "Could not find gem" even though the version exists in the index.The fix changes
s.dependenciestos.runtime_dependencies, since development dependencies are irrelevant to resolution.