Building JRuby: some classes are not rebuilt properly by "mvn package" #1470
It seems that some classes in JRuby are not rebuilt properly by "mvn package". There are various tests in the test suite that compare one version number in JRuby to another and these often fail as a result. Those are just the most visible failures; there are probably some nastier ones that are not caught by any tests.
To demonstrate the problem, I ran the following Bash script in a new, empty directory:
set -ue git clone https://github.com/jruby/jruby.git jruby cd jruby mvn package git checkout jruby-1_7 mvn package bin/jruby -v -e 'p org.jruby.embed.jsr223.JRubyEngineFactory.new.getEngineVersion'
The output from the final command is:
So "jruby -v" reports the correct version, but the JRubyEngineFactory thinks we are running 9000.dev. That class was probably compiled from the master branch and failed to get recompiled later.
Using grep I can see that only one class contains the string "9000.dev":
Here is my maven version info:
Here is my ant version info:
The text was updated successfully, but these errors were encountered:
$ mvn compile uses incremental compilation. so whatever changes by
after switching the branch you need to run
to fix your usecase would mean to turn off incremental compilation - not
Thank you very much for explaining, @mkristian. I should have said I am new to this stuff and not totally sure if it is a bug.
Running "mvn clean" after switching branches fixed the problem. Requiring "mvn clean" once in a while should not be a problem; I think in a typical C project if some compilation options or metadata in the Makefile changed you would have to do "make clean".
Should I submit a pull request that adds your information to BUILDING.md? It doesn't actually say how to clean or do an incremental compile.
…ntence about cleaning after switching branches. This information is derived from a comment by mkristian: jruby#1470 (comment)
…ntence about cleaning after switching branches. This information is derived from a comment by mkristian: #1470 (comment) [skip ci]