Fix generator issues with newer rubygems and bundler#9849
Fix generator issues with newer rubygems and bundler#9849ahukkanen wants to merge 21 commits intodecidim:developfrom
Conversation
|
It seems that I still have exactly the same problems that I had at #9766, so marking this as draft for now until investigating further. Bottom line is that my initial assumption seems incorrect. |
|
Tested this also locally and the proposed fix would actually solve #9839 but now the problem is with the generators spec, which are also broken if you run them locally under the same conditions. This is something I haven't figured out yet... |
|
Note to myself regarding that last CI problem: The problem seems to be if the gem environment already has different versions of some gems required what Decidim requires. In the particular case that I was debugging I found out that:
So the solution to this would be to always have exactly the same versions of gems installed as are loaded to RubyGems. I need to investigate a bit further what is causing the version mis-match, i.e. is it the same |
- Fix psych open ended dependency - Update minitest, parallel_tests, parser, rack, regexp_parser, rubocop-ast, tzinfo
Multiple versions of bundler cause the generators specs to fail with newer bundler versions. Yet to be investigated in which version this breaks exactly.
|
@ahukkanen can you merge with |
|
I mentioned it on our internal chat, but I think that is good to also leave it here for the people from the future: The error that we're seeing ( It was solved on rubygems ruby/rubygems#2196. My hypothesis on why it broke again is because they started removing these kinds of requires as there was an autoload related bug on JRuby ruby/rubygems#3751. They mention that these shouldn't be necessary, but maybe something that we're doing in the specs/generator produces a change in the Bundler/rubygems autoload? I didn't have the chance (yet) to try out if the naive solution (adding again the |
|
For what it's worth, we got this problem reported at ruby/rubygems#6145 and I plan to ship the fix with RubyGems 3.4.0 next week. |
|
Awesome @deivid-rodriguez, thank you very much! We didn't have time to allocate to this issue, and couldn't pinpoint exactly the reason why this was happening and make a proof of concept to report to rubygems. Thank you for letting it us know. We'll keep track of that issue and let you know if we have any problem with the fix once its released. |
|
No problem! I don't really know why it's happening either, a Ruby bug I guess. But the workaround for us is easy :) Keep up the good work! |
|
RubyGems 3.4.0 is out now with this fix. Happy holidays! :) |
|
Thanks for the fix @deivid-rodriguez, really nice Christmas gift from you! Turns out we had a bug in Decidim that I submitted a new PR for #10220. But your fix made it way easier to debug and fix the problem as the stacktrace made sense all of a sudden after upgrading RubyGems and Bundler. I will try upgrading RubyGems again after we have merged #10220. Happy new year! |
|
Awesome, really glad our releases made things easier! Keep up the good work 💪 |
|
Superseded by #10323. Closing this one. |
🎩 What? Why?
With rubygems 3.3.x which ships with bundler 2.3.x we have currently issues using the
decidimgenerators or actually any executables we provide (which is generally thedecidimexecutable).My assumption is that the key feature related to this issue that was added in the newer version of bundler is that it recognizes the bundler version based on the
Gemfile.lockand installs that particular bundler version in case it was not already installed and installs the gems under that bundler version.Apparently this approach has still some problems as the bundler versions get mixed. If you only have one version of bundler installed, there is no problem running the
decidimexecutables but if you have more than one version (2.3.x with an older version such as 2.2.x), this issue appears.To fix this issue, I am proposing that we remove the automatic copying of the
Gemfile.lockfiles into the newly generated Decidim application to get around this issue. Let's just let bundler generate theGemfile.locklocally.In fact, I don't even understand why we wanted to do this in the first place so if anyone has an idea why this is done, feel free to enlighten me.
As an extra, we can finally get rid of these messages (showed up after Ruby 3.1 upgrade) in the console once this is merged:
📌 Related Issues
Testing
See the replication instructions from #9839.
Also, see that the CI is green. We have many failing build examples e.g. at #9766 where I tried to initially update the bundler to newer one but I believe it failed because of this same reason.