pocke / rbs_rails

Apache License 2.0
285 stars 33 forks source link

Fix CI of ruby head #198

Closed ksss closed 3 years ago

ksss commented 3 years ago

Current ruby head(0182bf615a)'s ostruct was broken.

rake aborted!
NoMethodError: undefined method `each' for false:FalseClass

        options.rakelib.each do |rlib|
                       ^^^^^
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:705:in `raw_load_rakefile'
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:104:in `block in load_rakefile'
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:103:in `load_rakefile'
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:82:in `block in run'
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/home/runner/.rubies/ruby-head/lib/ruby/gems/3.1.0/gems/rake-13.0.3/lib/rake/application.rb:80:in `run'
bin/rake:4:in `<main>'

However, this problem does not occur in gemfied ostruct v0.4.0

ksss commented 3 years ago

Oh..., I don't know why fail on head. It's a success in my hands...

pocke commented 3 years ago

Thanks for reporting the issue! I've made an issue to the upstream, Bootsnap. https://github.com/Shopify/bootsnap/issues/376

Oh..., I don't know why fail on head. It's a success in my hands...

Because ostruct is not installed from RubyGems, I guess. Ruby-head contains ostruct v0.4.0 as a default gem. But the contained gem has difference from the RubyGems' ostruct v0.4.0; It has the problem. Then, bundle install tries installing ostruct v0.4.0 and it finds the default gem. So actually bundle install doesn't fetch the gem form RubyGems.org. So it uses the osturct gem with the problem even if it's specified in Gemfile.

We can confirm this behavior from CI output. https://github.com/pocke/rbs_rails/runs/3740973925#step:5:202 It prints "using", which means it uses the default gem as a local cache.

I guess you did gem install ostruct manually in your environment, so the gem installed ostruct was loaded in that case.

pocke commented 3 years ago

I've fixed the failure with another approach, disabling Bootsnap, by #199.

Cloud you rebase your other PRs?

ksss commented 3 years ago

OMG, What a cool works! Thanks!