warbler icon indicating copy to clipboard operation
warbler copied to clipboard

Properly compile gems

Open camertron opened this issue 11 years ago • 13 comments

I ran into some issues when setting config.compile_gems = true in my Warbler config:

  1. When constructing jar packages, warbler does not compile git-based gems (i.e. any gems specified via the :git or :github options in the Gemfile).
  2. When constructing war packages, warbler does not compile any gems, including git-based ones.
  3. When constructing jar packages, there is no way to specify a Ruby version (i.e. no 1.9-mode support).

This pull request introduces a trait called CompiledGems that addresses 1 and 2 above (see comments in the code for details). For number 3, I had to add this to my warbler config (note that there's no way to specify 2.0 mode, even using this hack):

config.webxml = Warbler::Traits::War::WebxmlOpenStruct.new
config.webxml.jruby.compat.version = '1.9'

I'm mostly submitting this PR to share what I've learned with others who have run into similar issues (doesn't need to be merged). I think there will need to be a more holistic look at warbler (maybe when JRuby 9000 gets released?) to really fix things right. For now, this trait is just a hack to help in the interim.

camertron avatar Mar 11 '15 17:03 camertron

Thanks for sharing this! I'm sorry you had so much trouble. This looks like a decent solution though, so I may end up merging it. I'll see if I can write up some tests to cover this trait.

You are correct that JRuby 9k may require some overhauling. But we'll definitely continue to support the 1.7.x line for some time.

jkutner avatar Mar 17 '15 07:03 jkutner

Thanks @jkutner! Also many thanks for warbler, it has been an indispensable tool to us :)

camertron avatar Mar 17 '15 16:03 camertron

@camertron any reason we are not merging ?

Gauravshah avatar Jan 17 '18 15:01 Gauravshah

@Gauravshah it's out of my hands since I don't have merge permissions. @jkutner any idea when this can be merged?

camertron avatar Jan 17 '18 17:01 camertron

thanks @camertron I am unable to figure out what people use for jruby on prod. Warbler is not being maintained actively. trinidad has no commits from over 2 years. puma is slow. Not sure what people use now.

Gauravshah avatar Jan 17 '18 18:01 Gauravshah

@Gauravshah I think the app server of choice for JRuby is torquebox. AFAIK it's actively maintained by the guys at Red Hat. We used warbler + glassfish for our last JRuby project.

camertron avatar Jan 17 '18 18:01 camertron

Is this still an issue with Warbler 2.0.4 (which support JRuby 9k)?

jkutner avatar Jan 18 '18 03:01 jkutner

@jkutner I'm not sure, perhaps the others can chime in?

camertron avatar Jan 18 '18 06:01 camertron

@jkutner it does not bundle git gems, verified on 2.0.4 version of warbler.

Gauravshah avatar Jan 18 '18 07:01 Gauravshah

Since this trait doesn't affect anything if you don't use it, I can merge it. But can you confirm that it works? Ideally would like to have a test for it.

jkutner avatar Jan 18 '18 14:01 jkutner

I think the app server of choice for JRuby is torquebox. AFAIK it's actively maintained by the guys at Red Hat.

nope, unfortunately, its not the case anymore. its mostly just Puma or .war + Tomcat/Jetty these days ...

kares avatar Jan 19 '18 06:01 kares

@kares then how do we generate war since warble is not being actively maintained ?

Gauravshah avatar Jan 19 '18 06:01 Gauravshah

@Gauravshah as far as I can tell .war generation works reasonably - have some folks that I am helping out and they're fine with Warbler as is (JRuby 9.1 + Rails 4.2). not 100% sure what exactly your issue is - git gems bundle fine. assuming you're having a problem with git + compiled gems than disable compilation.

I am sure a proper resolution (with tests) will be merged - as noted we do not know whether this piece of PR actually resolves your problem (again not exactly clear what issue you're having) ... if you believe so add a piece of test so we understand. otherwise the minimum you could do is a simple reproducer.

we shall not get into slightly off-topic discussions on open-source project support in a PR thread, good practice that works for me is to expect 'nothing' from folks maintaining projects (for free) that I am benefiting from and if I run into issues I do try to be helpful or support the project anyway I can ...

kares avatar Jan 19 '18 08:01 kares