Skip to content

Commit

Permalink
Merge pull request #6301 from headius/jdk14
Browse files Browse the repository at this point in the history
Reconfigure some CI builds and add JDK14
  • Loading branch information
headius committed Jun 28, 2020
2 parents f03792d + 5e8e4ce commit 5ce7d14
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 31 deletions.
50 changes: 36 additions & 14 deletions .travis.yml
Expand Up @@ -50,12 +50,6 @@ matrix:
- jruby -S rake test:mri:core:int
env: JRUBY_OPTS='$JRUBY_OPTS -J-Xmx1G'

- name: MRI core fullint
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:mri:core:fullint
env: JRUBY_OPTS='$JRUBY_OPTS -J-Xmx1G'

- name: MRI core jit
script:
- mvn clean package -Pbootstrap
Expand All @@ -67,6 +61,12 @@ matrix:
- mvn clean package -Pbootstrap
- jruby -S rake test:mri:core:jit

- name: MRI core jit jdk14
jdk: openjdk14
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:mri:core:jit

- name: MRI extra
script:
- mvn clean package -Pbootstrap
Expand All @@ -90,6 +90,12 @@ matrix:
- mvn clean package -Pbootstrap
- jruby -S rake spec:ruby:fast

- name: spec/ruby fast jdk14
jdk: openjdk14
script:
- mvn clean package -Pbootstrap
- jruby -S rake spec:ruby:fast

- name: spec/ruby slow
script:
- mvn clean package -Pbootstrap
Expand All @@ -109,32 +115,35 @@ matrix:
- name: concurrent ruby
script: tool/concurrent-ruby-travis.sh

- name: JRuby tests jit
- name: JRuby tests int
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:jruby
- jruby -S rake test:jruby:int

- name: JRuby tests jit jdk11
- name: JRuby tests jit indy jdk11
jdk: openjdk11
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:jruby
env: JRUBY_OPTS=-Xcompile.invokedynamic

- name: JRuby tests jit indy
- name: JRuby tests jit indy jdk14
jdk: openjdk14
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:jruby
env: JRUBY_OPTS=-Xcompile.invokedynamic

- name: JRuby tests aot
- name: JRuby tests jit indy
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:jruby:aot
- jruby -S rake test:jruby
env: JRUBY_OPTS=-Xcompile.invokedynamic

- name: JRuby tests fullint
- name: JRuby tests aot
script:
- mvn clean package -Pbootstrap
- jruby -S rake test:jruby:fullint
- jruby -S rake test:jruby:aot

- name: JRuby slow tests
script:
Expand All @@ -152,6 +161,12 @@ matrix:
- mvn clean package -Pbootstrap
- jruby -S rake spec:ji

- name: JI specs jdk14
jdk: openjdk14
script:
- mvn clean package -Pbootstrap
- jruby -S rake spec:ji

- name: Compiler specs
script:
- mvn clean package -Pbootstrap
Expand All @@ -170,6 +185,13 @@ matrix:
- jruby -S rake spec:compiler
env: JRUBY_OPTS=-Xcompile.invokedynamic

- name: Compiler specs indy jdk14
jdk: openjdk14
script:
- mvn clean package -Pbootstrap
- jruby -S rake spec:compiler
env: JRUBY_OPTS=-Xcompile.invokedynamic

- name: FFI specs
script:
- mvn clean package -Pbootstrap
Expand Down
1 change: 1 addition & 0 deletions bin/.dev_mode.java_opts
@@ -1,5 +1,6 @@
-XX:+TieredCompilation
-XX:TieredStopAtLevel=1
-XX:-PrintWarnings
-Djruby.compile.mode=OFF
-Djruby.compile.invokedynamic=false
-Djnr.ffi.asm.enabled=false
Expand Down
13 changes: 10 additions & 3 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -3883,9 +3883,11 @@ public RaiseException newErrnoFromInt(int errno) {

private final static Pattern ADDR_NOT_AVAIL_PATTERN = Pattern.compile("assign.*address");

public RaiseException newErrnoEADDRFromBindException(BindException be) {
return newErrnoEADDRFromBindException(be, null);
}
public RaiseException newErrnoFromBindException(BindException be, String contextMessage) {
Errno errno = Helpers.errnoFromException(be);

return newErrnoFromErrno(errno, contextMessage);
}

public RaiseException newErrnoEADDRFromBindException(BindException be, String contextMessage) {
String msg = be.getMessage();
Expand Down Expand Up @@ -5710,4 +5712,9 @@ private void deprecatedNetworkStackProperty() {
}
}

@Deprecated
public RaiseException newErrnoEADDRFromBindException(BindException be) {
return newErrnoEADDRFromBindException(be, null);
}

}
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/ext/socket/RubyBasicSocket.java
Expand Up @@ -737,6 +737,10 @@ protected IRubyObject addrFor(ThreadContext context, InetSocketAddress addr, boo
return RubyArray.newArray(runtime, ret0, ret1, ret2, ret3);
}

protected static String bindContextMessage(IRubyObject host, int port) {
return "bind(2) for " + host.inspect() + " port " + port;
}

@Deprecated
public IRubyObject recv(IRubyObject[] args) {
return recv(getRuntime().getCurrentContext(), args);
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java
Expand Up @@ -103,7 +103,11 @@ public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {

break;
case 1:
_host = context.nil;
_port = args[0];
break;
default:
throw runtime.newArgumentError(args.length, 1, 2);
}

int port = SocketUtils.getPortFrom(context, _port);
Expand All @@ -124,7 +128,7 @@ public IRubyObject initialize(ThreadContext context, IRubyObject[] args) {
throw SocketUtils.sockerr(runtime, "initialize: name or service not known");

} catch(BindException e) {
throw runtime.newErrnoEADDRFromBindException(e);
throw runtime.newErrnoFromBindException(e, bindContextMessage(_host, port));

} catch(SocketException e) {
String msg = e.getMessage();
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ext/socket/RubyUDPSocket.java
Expand Up @@ -205,17 +205,17 @@ else if (host instanceof RubyFixnum) {
throw SocketUtils.sockerr(runtime, "bind: name or service not known");
}
catch (BindException e) {
throw runtime.newErrnoEADDRFromBindException(e);
throw runtime.newErrnoFromBindException(e, bindContextMessage(host, port));
}
catch (AlreadyBoundException e) {
throw runtime.newErrnoEINVALError("bind(2) for " + host.inspect() + " port " + port);
throw runtime.newErrnoEINVALError(bindContextMessage(host, port));
}
catch (SocketException e) {
final String message = e.getMessage();
if ( message != null ) {
switch ( message ) {
case "Permission denied" :
throw runtime.newErrnoEACCESError("bind(2) for " + host.inspect() + " port " + port);
throw runtime.newErrnoEACCESError(bindContextMessage(host, port));
}
}
throw sockerr(runtime, "bind: name or service not known", e);
Expand Down
20 changes: 12 additions & 8 deletions core/src/main/java/org/jruby/runtime/Helpers.java
Expand Up @@ -5,6 +5,7 @@
import java.io.IOException;
import java.lang.reflect.Array;

import java.net.BindException;
import java.net.PortUnreachableException;
import java.nio.channels.ClosedChannelException;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -261,16 +262,17 @@ public static Errno errnoFromException(Throwable t) {
} catch (AccessDeniedException ade) {
return Errno.EACCES;
} catch (DirectoryNotEmptyException dnee) {
switch (dnee.getMessage()) {
case "File exists":
return Errno.EEXIST;
case "Directory not empty":
return Errno.ENOTEMPTY;
}
return errnoFromMessage(dnee);
} catch (BindException be) {
return errnoFromMessage(be);
} catch (Throwable t2) {
// fall through
}

return errnoFromMessage(t);
}

private static Errno errnoFromMessage(Throwable t) {
final String errorMessage = t.getMessage();

if (errorMessage != null) {
Expand Down Expand Up @@ -301,6 +303,8 @@ public static Errno errnoFromException(Throwable t) {
return Errno.ENETUNREACH;
case "Address already in use":
return Errno.EADDRINUSE;
case "Cannot assign requested address":
return Errno.EADDRNOTAVAIL;
case "No space left on device":
return Errno.ENOSPC;
case "Message too large": // Alpine Linux
Expand All @@ -315,8 +319,8 @@ public static Errno errnoFromException(Throwable t) {
case "permission denied":
case "Permission denied":
return Errno.EACCES;
case "Protocol family unavailable":
return Errno.EADDRNOTAVAIL;
case "Protocol family not supported":
return Errno.EPFNOSUPPORT;
}
}
return null;
Expand Down
6 changes: 4 additions & 2 deletions rakelib/test.rake
Expand Up @@ -61,7 +61,8 @@ namespace :test do

compile_flags = {
:default => :int,
:int => ["-X-C"],
# interpreter is set to threshold=1 to encourage full builds to run for code called twice
:int => ["-X-C", "-Xjit.threshold=1", "-Xjit.background=false"],
# Note: jit.background=false is implied by jit.threshold=0, but we add it here to be sure
:fullint => ["-X-C", "-Xjit.threshold=0", "-Xjit.background=false"],
:jit => ["-Xjit.threshold=0", "-Xjit.background=false", get_meta_size.call()],
Expand All @@ -80,7 +81,8 @@ namespace :test do

namespace :mri do
jruby_opts = {
int: "--dev",
# interpreter is set to threshold=1 to encourage full builds to run for code called twice
int: "--dev -Xjit.threshold=1 -Xjit.background=false",
fullint: "-X-C -Xjit.threshold=0 -Xjit.background=false",
jit: "-Xjit.threshold=0 -Xjit.background=false",
aot: "-X+C -Xjit.background=false #{get_meta_size.call()}"
Expand Down

0 comments on commit 5ce7d14

Please sign in to comment.