Support bundler 2
Unless using ruby 2.3 or older, or even on ruby 2.3 if a modern enough bundler is used, the bundler gemspec should never have its loaded_from attribute set to a missing file, so this whole hack shouldn't be necessary.
Just checking CI for now.
@deivid-rodriguez Really appreciate this input!
@deivid-rodriguez I note that this project uninstalls Bundler and installs a Bundler < 2. I'll poke a little into that, see if a newer set of Bundler can be used, perhaps update the matrix to be about current Bundler & RubyGems.
I did some work last week on getting warbler's CI green, I should be able to propose a separate PR for that soon :+1:.
I will try to support bundler 2 in this PR.
Everything seems to be fine, and with the most recent bundler & rubygems a couple of hacks can be removed, apparently. I still want to I will see whether it's still worth keeping those hacks around in order to support old versions.
Something problematic is that default gems are not correctly packaged inside the war file. That's why the CI was pinned to rubygems 2.7.11, because it's the most recent version that does not install bundler as a default gem. But this is an existing issue, unrelated to the bundler version in use. In this PR, I'm using a different workaround, namely, manually installing bundler as a regular gem so that it's correctly packaged.
@deivid-rodriguez This is wonderful work, and I did merge the "Remove Rake 12 from matrix" change, too, would that take this PR closer to green?
Yeah, PR should be green now, but I'm leaving it as a draft for now since I still want to verify a few things.
@deivid-rodriguez Huh, it LOOKS like that actually fixed it.
Seems to have stalled since 2021?
I actually rebased this a couple months ago and fixed one more issue, but it was still not ready.
How are we now? Close to releaseable?
I'm not actively working on this, nor planning to. Sorry.
@deivid-rodriguez sorry to bother, I know it's been 2 years, but do you have a (draft) list of what remains to do here for this to be merged in? I'm using the code from this branch for some time and it kind of works for me. And if it's not something massive probably I can have a go at it.
@headius without this, what is the recommended way to deploy new JRuby apps today? Especially if Rails 7 requires Ruby 3 which (I assume) requires Bundler 2. I thought about replacing the whole thing with a simple script but wanted to hear your thoughts on it first 🙏
@dolzenko I stopped working on this patch a while ago. I think I still had to get a few tests to pass. But if you're using this succesfully, I guess this is probably still an improvement even if some tests fail. Happy to give this a rebase if there's interest in merging it.
@deivid-rodriguez I integrated the code in the midst of difficult release process in a hurry and I have this in the build script
# (added while trying to fix "rake not found" warble error)
bundle config set cache_all true
bundle cache --verbose
bundle install --deployment
jruby -G -S warble compiled war
(kind of a gross hack where I just almost bruteforced through the different bundle invocation scenarios to find the one working)
but now I definitely have the needed time to at least test it properly, or maybe even look into fixing the tests if you say its only that.
Actually, a few comments above I claimed that CI was green, so maybe it was not that. Honestly, I forgot what the remaining issues were, sorry :disappointed:.