warbler icon indicating copy to clipboard operation
warbler copied to clipboard

Support bundler 2

Open deivid-rodriguez opened this issue 4 years ago • 16 comments

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 avatar May 10 '21 19:05 deivid-rodriguez

@deivid-rodriguez Really appreciate this input!

olleolleolle avatar May 11 '21 07:05 olleolleolle

@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.

olleolleolle avatar May 29 '21 09:05 olleolleolle

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:.

deivid-rodriguez avatar Jun 05 '21 08:06 deivid-rodriguez

I will try to support bundler 2 in this PR.

deivid-rodriguez avatar Jun 12 '21 14:06 deivid-rodriguez

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 avatar Jun 12 '21 18:06 deivid-rodriguez

@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?

olleolleolle avatar Jun 13 '21 06:06 olleolleolle

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 avatar Jun 13 '21 07:06 deivid-rodriguez

@deivid-rodriguez Huh, it LOOKS like that actually fixed it.

olleolleolle avatar Jun 13 '21 11:06 olleolleolle

Seems to have stalled since 2021?

headius avatar Oct 17 '22 18:10 headius

I actually rebased this a couple months ago and fixed one more issue, but it was still not ready.

deivid-rodriguez avatar Oct 17 '22 18:10 deivid-rodriguez

How are we now? Close to releaseable?

headius avatar Nov 04 '22 19:11 headius

I'm not actively working on this, nor planning to. Sorry.

deivid-rodriguez avatar Nov 04 '22 19:11 deivid-rodriguez

@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 avatar Mar 27 '24 07:03 dolzenko

@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 avatar Mar 27 '24 11:03 deivid-rodriguez

@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.

dolzenko avatar Mar 27 '24 11:03 dolzenko

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:.

deivid-rodriguez avatar Mar 27 '24 11:03 deivid-rodriguez