At_exit doesn't appear to chain properly -> Possible Re: [jruby-user] JRuby 1.1.3 by end of week...N

Hi,

I couldn’t find this as a bug in the tracker but before I try to create
one I’d like to validate that its a bug with you all.

So a coworker and I are trying to get RCov to work with JRuby and we are
almost there. However, the latest issue that’s preventing it from
working centers around running rcov itself. rcov uses multiple BEGIN
and END blocks. And the problem appears to be with the END block…
which I think is an alias for at_exit.

here is an example:
If we have code like (you can replace the at_exit with end):

puts “Beginning of ruby file”
BEGIN { puts “my begin 1”}
at_exit {puts “my end 1”}
BEGIN {puts “my begin 2”}
at_exit { puts “my end 2”}
at_exit { puts “my end exit”; exit }
puts “End of ruby file”

The output in MRI is:
my begin 1
my begin 2
Beginning of ruby file
End of ruby file
my end exit
my end 2
my end 1

the output with JRuby is:
my begin 1
my begin 2
Beginning of ruby file
End of ruby file
my end exit

This is causing the latest issue with RCov in getting results to report
properly.

So the question is… is this a bug in JRuby? I think that END blocks
get turned into Procs which have different exit behavior than lambdas.

If it’s not a bug in jruby I’ll submit a patch to the Rcov team because
we can work around this issue by changing the rcov script.

Thanks for your help!
Jay
and
Ray

Hi Jay and Ray, :wink:

I think this is a bug in JRuby, all at_exit blocks need to be executed
indeed.

Please file an issue and I’ll try fix it before JRuby 1.1.3, time
permitting.

Thanks,
–Vladimir

On Wed, Jul 16, 2008 at 4:13 PM, Jay McGaffigan
[email protected] wrote:

puts “Beginning of ruby file”
End of ruby file
This is causing the latest issue with RCov in getting results to report


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email