JRuby AOT compiler should produce version information
-----------------------------------------------------
Key: JRUBY-2750
URL: http://jira.codehaus.org/browse/JRUBY-2750
Project: JRuby
Issue Type: Bug
Components: Compiler
Reporter: Peter K Chan
Currently, the JRuby AOT compiler does not output any kind of version
information in the produced class files. This makes it difficult to debug, if a
ruby.rb file, compiled by an earlier AOT compiler to ruby.class, is loaded by a
later and incompatible version of the JRuby runtime.
A specific use case from my project: I have some ruby files that are library
dependencies (such as optparse.rb or Active Support), and I pre-compile them to
be loaded as a lib.jar. Without version information and compatibility check, it
will be difficult to determine any runtime error, if I upgrade to a later and
incompatible JRuby runtime, while still using the lib.jar compiled by an
earlier version.
This may also be useful for generic pre-compilation of popular Ruby libraries,
such as active_support.jar or rails.jar, which can then be deployed or released
without each user having to pre-compile their own copies (more work will be
needed, but compiler version information will be a necessary feature to ensure
safe usage of older released compiled JRuby class files).
My suggestion is for the compiler to output its version information in the
produced class files. At runtime, the JRuby runtime will consult the version
information and check to make sure that the loaded code is compatible with its'
own version. If the loaded file is not compatible, an appropriate exception can
be thrown (rather then the current way of various Java linkage error with no
indication that they are due to JRuby version compatibility).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email