Skip to content

Building JRuby: some classes are not rebuilt properly by "mvn package" #1470

@DavidEGrayson

Description

@DavidEGrayson

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:

jruby 1.7.11-SNAPSHOT (1.9.3p392) 2014-01-28 24536e0 on OpenJDK 64-Bit Server VM 1.7.0_51-b00 [linux-amd64]
"9000.dev"

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":

$ grep 9000.dev -r .
# Binary file ./core/target/classes/org/jruby/embed/jsr223/JRubyEngineFactory.class matches

Here is my maven version info:

$  mvn --version
Apache Maven 3.1.1 (NON-CANONICAL_2013-10-11_13-55_root; 2013-10-11 02:55:32-0700)
Maven home: /opt/maven
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.12.8-1-arch", arch: "amd64", family: "unix"

Here is my ant version info:

$  ant -version
Apache Ant(TM) version 1.9.3 compiled on January 19 2014

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions