oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
2.99k stars 180 forks source link

Gem::DependencyResolutionError: conflicting dependencies b (~> 2.0) and b (>= 0) #3477

Closed martinemde closed 4 months ago

martinemde commented 4 months ago

I was making a small fix to the rubygems tests and triggered a bug in truffleruby.

The original somewhat unrelated bug was reported in https://github.com/rubygems/rubygems/issues/7493, but it caused a fix that produced this incompatibility.

The ignored block meant the dependency wasn't added, however, adding it produces a failure in truffleruby and jruby. I tried a few variations on the test, using "1.0" vs 1 for both versions or neither of them.

Here is one of the test runs.

This seems like a legitimate bug because >= 0 is compatible with ~> 2.

eregon commented 4 months ago

There seems to be the same test failure on JRuby: https://github.com/rubygems/rubygems/actions/runs/8104936668/job/22152461045?pr=7494#step:8:537 So I would think it's a bug of the PR or existing logic, or maybe just a flaky test. It could also be a race condition that happens on JRuby and TruffleRuby but less likely on CRuby.

eregon commented 4 months ago

I'm confident this is a problem in RubyGems/that test and not truffleruby-specific (in fact it also happens on JRuby). The fact it works (AFAIK) fine before that change seems to make it even more likely that's the case. If it's really a TruffleRuby bug we would need a small reproducer.

martinemde commented 4 months ago

Thanks for taking a look @eregon! I'll dig more. The jruby bug does seem to indicate it's possible to fix in rubygems. Sorry for the false positive.