Skip to content

Commit

Permalink
Merge branch 'master' into ruby-2.5
Browse files Browse the repository at this point in the history
headius committed Feb 17, 2018

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
2 parents ef5e53a + ea6131a commit efe579e
Showing 1,124 changed files with 20,306 additions and 13,032 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -12,9 +12,8 @@ before_install:
- unset _JAVA_OPTIONS
- rm ~/.m2/settings.xml
- export MAVEN_SKIP_RC=true
- mvn -Xmx32M -v | grep 1.7.0; if [ $? = 0 ]; then export MAVEN_OPTS="-XX:MaxPermSize=160M"; else export MAVEN_OPTS="-XX:MaxMetaspaceSize=144M -XX:CompressedClassSpaceSize=96M"; fi
- export MAVEN_OPTS="-Xms64M -Xmx512M $MAVEN_OPTS"
- export JAVA_OPTS="$JAVA_OPTS"
- export MAVEN_OPTS="-Xmn64M -Xmx512M -XX:MaxMetaspaceSize=144M -XX:CompressedClassSpaceSize=96M"
- export JAVA_OPTS="$JAVA_OPTS -XX:MaxMetaspaceSize=96M -XX:CompressedClassSpaceSize=96M"

before_script:
- unset GEM_PATH GEM_HOME IRBRC JRUBY_OPTS
@@ -120,8 +119,10 @@ notifications:

services:
- redis-server
- haveged

addons:
apt:
packages:
- oracle-java9-installer
- haveged
14 changes: 8 additions & 6 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ verify that JRuby is still fully functional.

### Hacking the Build System

for a general overview of the different directories and maven artifacts see [JRuby Build)](https://github.com/jruby/jruby/wiki/JRuby-Build----Some-Inside-Info)
for a general overview of the different directories and maven artifacts see [JRuby Build](https://github.com/jruby/jruby/wiki/JRuby-Build----Some-Inside-Info)

For this only the ***pom.rb*** needs to edited. using mvn-3.3.x or the maven wrapper `./mvnw` will generate the pom.xml file where needed. For the jar files of the build those pom.xml will be generated for some use-cases, i.e. some IDEs need them.

@@ -123,19 +123,21 @@ from MRI's tests (under test/mri), use one of the following commands:
The MRI suite (under `test/mri`) has a runner script in `test/mri/runner.rb` that sets up
an appropriate test environment. Many of the MRI tests will need to be run via this script.
```
jruby -r ./test/mri_test_env.rb test/mri/runner.rb test/mri/<path to test>
jruby test/mri/runner.rb test/mri/<path to test>
```

You can pass `-v` to the runner for verbose output or `-n test_method_name` to only run a single test method. If you are interested in all failures you can exlude the -r option (of mri_test_env.rb). Some excluded tests are inherent limitations of JRuby and some are just problems we have not gotten to yet.
You can pass `-v` to the runner for verbose output or `-n test_method_name` to only run a single test method.

#### Run a test file with known-failing tests excluded

The runner script provides a mechanism for "excluding" known failing tests. Ruby scripts under `test/mri/exclude`, named based on the name of the test case's class, exclude with comment tests known to fail.
The runner script provides a mechanism for "excluding" known failing tests. These are usually features that JRuby has not yet implemented or can't implement on the JVM.

To run a given test with these excludes enabled, you can use the EXCLUDES environment variable:
Excludes are in the form of Ruby scripts under `test/mri/exclude`, named based on the name of the test case's class, exclude with comment tests known to fail.

To run a given test with these excludes enabled, you can use the --excludes flag:

```
EXCLUDES=test/mri/excludes bin/jruby test/mri/runner.rb <test file>
bin/jruby test/mri/runner.rb --excludes=test/mri/excludes <test file>
```

#### Run a single Ruby spec
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JRuby is Copyright (c) 2007-2017 The JRuby project, and is released
JRuby is Copyright (c) 2007-2018 The JRuby project, and is released
under a tri EPL/GPL/LGPL license. You can use it, redistribute it
and/or modify it under the terms of the:

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# JRuby - an implementation of the Ruby language on the JVM

Master: [![Build Status](https://travis-ci.org/jruby/jruby.svg?branch=master)](https://travis-ci.org/jruby/jruby)
9.1 branch: [![Build Status](https://travis-ci.org/jruby/jruby.svg?branch=jruby-9.1)](https://travis-ci.org/jruby/jruby/branches)
1.7 branch: [![Build Status](https://travis-ci.org/jruby/jruby.svg?branch=jruby-1_7)](https://travis-ci.org/jruby/jruby/branches)

## About
2 changes: 1 addition & 1 deletion bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -244,7 +244,7 @@ do
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
if expr "$val" : '.*[.]' > /dev/null; then
if expr -- "$val" : '.*[.]' > /dev/null; then
java_args=("${java_args[@]}" "-Djruby.${val}")
else
ruby_args=("${ruby_args[@]}" "-X${val}")
8 changes: 4 additions & 4 deletions bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -26,9 +26,9 @@ progname=`basename "$0"`

while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
if expr "$link" : '/' > /dev/null; then
link=`expr -- "$ls" : '.*-> \(.*\)$'`
if expr -- "$link" : '.*/.*' > /dev/null; then
if expr -- "$link" : '/' > /dev/null; then
PRG="$link"
else
PRG="`dirname ${PRG}`/${link}"
@@ -202,7 +202,7 @@ do
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
if expr "$val" : '.*[.]' > /dev/null; then
if expr -- "$val" : '.*[.]' > /dev/null; then
java_args="${java_args} -Djruby.${val}"
else
ruby_args="${ruby_args} -X${val}"
18 changes: 12 additions & 6 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -46,18 +46,18 @@
jar 'com.github.jnr:jnr-enxio:0.16', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.17', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.42', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.44', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.9', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.1.7'
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'

jar 'org.jruby.joni:joni:2.1.13'
jar 'org.jruby.joni:joni:2.1.14'
jar 'org.jruby.extras:bytelist:1.0.15'
jar 'org.jruby.jcodings:jcodings:1.0.26'
jar 'org.jruby.jcodings:jcodings:1.0.27'
jar 'org.jruby:dirgra:0.3'

jar 'com.headius:invokebinder:1.10'
jar 'com.headius:invokebinder:1.11'
jar 'com.headius:options:1.4'

jar 'bsf:bsf:2.4.0', :scope => 'provided'
@@ -271,7 +271,10 @@
'outputFile' => '${jruby.basedir}/lib/jruby.jar',
'transformers' => [ { '@implementation' => 'org.apache.maven.plugins.shade.resource.ManifestResourceTransformer',
'mainClass' => 'org.jruby.Main' } ],
'createSourcesJar' => '${create.sources.jar}' )
'createSourcesJar' => '${create.sources.jar}',
filters:
{filter: {artifact: 'com.headius:invokebinder', excludes: {exclude: '**/module-info.class'}}}
)
end

[:all, :release, :main, :osgi, :j2ee, :complete, :dist, :'jruby_complete_jar_extended', :'jruby-jars' ].each do |name|
@@ -293,7 +296,10 @@
relocations: [
{pattern: 'org.objectweb', shadedPattern: 'org.jruby.org.objectweb' },
{pattern: 'me.qmx.jitescript', shadedPattern: 'org.jruby.me.qmx.jitescript'},
] )
],
filters:
{filter: {artifact: 'com.headius:invokebinder', excludes: {exclude: '**/module-info.class'}}}
)
end
end
end
88 changes: 84 additions & 4 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -135,7 +135,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.42</version>
<version>3.0.44</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
@@ -173,7 +173,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.joni</groupId>
<artifactId>joni</artifactId>
<version>2.1.13</version>
<version>2.1.14</version>
</dependency>
<dependency>
<groupId>org.jruby.extras</groupId>
@@ -183,7 +183,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.26</version>
<version>1.0.27</version>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
@@ -193,7 +193,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.headius</groupId>
<artifactId>invokebinder</artifactId>
<version>1.10</version>
<version>1.11</version>
</dependency>
<dependency>
<groupId>com.headius</groupId>
@@ -620,6 +620,14 @@ DO NOT MODIFIY - GENERATED CODE
</transformer>
</transformers>
<createSourcesJar>${create.sources.jar}</createSourcesJar>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -684,6 +692,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -722,6 +738,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -760,6 +784,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -798,6 +830,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -836,6 +876,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -874,6 +922,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -912,6 +968,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -950,6 +1014,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
@@ -988,6 +1060,14 @@ DO NOT MODIFIY - GENERATED CODE
<shadedPattern>org.jruby.me.qmx.jitescript</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>com.headius:invokebinder</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
30 changes: 30 additions & 0 deletions core/src/main/java/Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import org.jruby.Ruby;

import javax.script.ScriptContext;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
import java.io.IOException;

public class Test {
public static void main(String[] args) throws InterruptedException, ScriptException, ClassNotFoundException, IOException {
for (int i = 0; i < 100; i++) blah();

System.gc();
System.gc();
Thread.sleep(5000);

System.out.println(Ruby.getGlobalRuntime().getFilenoUtil().getNumberOfWrappers());

}

private static void blah() throws ScriptException {
ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
final ScriptEngine engine = scriptEngineManager.getEngineByName("jruby");
final ScriptContext scriptContext = new SimpleScriptContext();
scriptContext.setAttribute("org.jruby.embed.termination", true, ScriptContext.ENGINE_SCOPE);

engine.eval("print 'test\n'", scriptContext);
}
}
Loading

0 comments on commit efe579e

Please sign in to comment.