ruby / gem_rbs_collection

A collection of RBS for gems.
MIT License
246 stars 101 forks source link

Concurrent appears to be causing issues. #552

Open mckaysalisbury opened 1 month ago

mckaysalisbury commented 1 month ago

I have included a bunch of gems from this repo in my collection. Specifically, I need Concurrent::Map from the concurrent-ruby gem.

However, when including this gem steep reports an error for both signatures in this file.

https://github.com/ruby/gem_rbs_collection/blob/7a105f52053ce1c708b605dfa9c1ab8473424036/gems/concurrent-ruby/1.1/utility/processor_counter.rbs#L2

Non-overloading method definition of `physical_processor_count` in ``::Concurrent`` cannot be duplicated
  Diagnostic ID: RBS::DuplicateMethodDefinition

When I comment out the two method signatures in that line, everything is fine.

Is there a better workaround?

pocke commented 1 month ago

Do you specify the require: false option to the steep gem in the Gemfile?

This definition is probably duplicated in concurrent-ruby and steep. You can avoid this problem by skipping loading steep gem's RBS.

https://github.com/soutaro/steep/blob/a868762c2bd09f0954b05cdd9eab1819e14a51d3/sig/shims/concurrent-ruby.rbs#L19

mckaysalisbury commented 1 month ago

I have tried skipping that particular gem, but other .rbs files in the collection for the gem are required and unduplicated, so that didn't work.

pocke commented 1 month ago

Thanks for your try. I have no idea of the cause for now...

Could you give me a (minimum) reproduction code? Gemfile, Gemfile.lock, rbs_collection.yaml, and rbs_collection.lock.yaml are necessary to reproduce a problem related to rbs collection.

mckaysalisbury commented 1 month ago

Hmm, I'm not sure how much I'm at liberty to share. I'll try to create a repro.