Compiling doesn't compile any included gems (and for most projects thats the largest portion of the code base).
After doing this PR I ran the sample_jar in the spec folder against 1.4.3 and compared the output jar's files with this PR's jar files, the only added files are all the .class files within the gems folder.
Refactor compile process to also compile all included gems in the sys…
Add 1.8.7 support, didnt know that select returned an array of arrays…
… in 1.8.7!
Older RUBY versions uses a different version of the included gem and …
…so the number of .class files compiled changes.
Any update on this? This is kind of a useful feature IMO.
sorry, i haven't had a chance to look at it yet. I'll get to it very soon.
I'd like to make this configurable, at least for now, because I'm afraid making it the default will mess up some existing users who compile with weird gems. I think making this the default in 1.5.0 is a good idea, but we're not ready for that yet.
I've pushed the branch https://github.com/jruby/warbler/tree/full_compiled_and_configurable with your changes, plus my changes to make it configurable. If you have a chance, please test it out and make sure it still does what you intended. Any other feedback would be greatly welcomed.
Really interested in seeing this in warbler, but it looks like this breaks with a large number of files (e.g. Rails App).
Yeah looks great. I agree, too much of a feature to add into 1.4 as a default option.
As for the stack trace which @MSNexploder is experiencing, I believe that to be an existing bug. Since warbler puts all ruby files on the command line which means depending on your system you'll eventually hit the limit. Is this something that could be solved easily by just doing an each_slice on the list of files to be compiled?
Whops, @uranazo is my other github account... So that reply above is me...
Just out of curiosity, does anyone know what the impact to the speed of an application would be (or how to test it) before and after this change? I assume that running in interpreted mode for a majority of the codebase must be a slow down, does JRuby compile during first interpret and then run or run in a completely interpreted mode for each request (where code is not compiled)?
Do we know if there is an existing issue open for the problem @MSNexploder saw? If it is en existing bug i'm going to merge my branch into master and close this one. sound ok?
It is an existing issue for sure, this PR just exacerbates the issue and makes it more obvious. The file list to jrubyc needs to be run in sets as to avoid the shell character/parameter limit. The issue can be seen in master by running on a large set of files as @MSNexploder describes. Like I suggested before, this can probably be solved via an each_slice(some_num) on the list of files to be compiled. The only thing that would need to be looked into would be what a suitable number would be, as to avoid the issue in most common shells.
BTW, I don't see an issue specifically for the issue @MSNexploder reported. Do one of you (@jkutner or @MSNexploder) want to report it?
@MSNexploder can you check that my code in https://github.com/jruby/warbler/tree/full_compiled_and_configurable fixes your error? I've chosen to compile 5000 files in each chuck, because that seems to be reasonable on OSX. But I haven't been able to determine what would be suitable on other platforms.
@jkutner 5000 did not work for me - failing with the same error. 2500 works reliably for me.
heh, glad i checked. if i get any reports of it not working, I'll make it configurable.