Closed EugenMayer closed 7 years ago
there's a default slice size 2500 ... setting the default lower would cause more javac
processes to spawn and warbling would get slower. the support that is there is fairly recent to help identifying compilation issues. we're certainly willing to accept PRs for further improving the current state.
@kares my default was zero, not sure if this here is a expectation issue. No matter what your application internal default is ( 2500 ) the configuration default is zero and should be addressed.
double checked, that would mean a failure (tested with JRuby 9.1.5.0) and also no compiling :
jruby-9.1.5.0 :001 > [1, 2].each_slice(0) { |slice| puts slice.inspect }
ArgumentError: invalid slice size
from org/jruby/RubyArray.java:1777:in `each_slice'
from (irb):1:in `<eval>'
from org/jruby/RubyKernel.java:995:in `eval'
from org/jruby/RubyKernel.java:1296:in `loop'
from org/jruby/RubyKernel.java:1115:in `catch'
from org/jruby/RubyKernel.java:1115:in `catch'
from /opt/local/rvm/rubies/jruby-9.1.5.0/bin/irb:13:in `<main>'
Not sure what happened here but with default settings I was getting aforementioned compilation of .rb file failed
error, with WARBLER_COMPILED_FILES_SLICE=10
I was able to track it down to
SyntaxError: cache/jruby/2.6.0/gems/actioncable-5.0.7.2/lib/rails/generators/channel/templates/channel.rb:1: syntax error, unexpected '<'
<% module_namespacing do -%>
^
The default slice_size is 0, which leads to an issue tht e.g. if a gem connot be compiled, lets say erubis due to the syntax issue here: https://github.com/EugenMayer/erubis/commit/d34acfdb7399b64b69bdb8dfb85a596579b4d3cc
then you end up having just a message
compilation of .rb file failed
and thats it, also with--trace
no further information givenUsing slice_size 10 here https://github.com/jruby/warbler/blob/master/lib/warbler/jar.rb#L58 , i end up having proper errors like
or
for the issue with https://github.com/rails/rails/blob/master/activejob/lib/rails/generators/job/templates/job.rb
I suggest either having a setting in warble.rb to set it to zero, but by default, make it non zero so people do not run into such dead-ends an probably stop there jruby evaluation because "things magically wont compile"
Thanks!