Skip to content

Commit

Permalink
[Truffle] Added an option -Xtruffle.runtime.version_check=false to tu…
Browse files Browse the repository at this point in the history
…rn off Truffle version check.
  • Loading branch information
chrisseaton committed Sep 18, 2014
1 parent e1334fd commit 03e5101
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
Expand Up @@ -667,13 +667,15 @@ private void logScriptResolutionFailure(String path) {
}

public static void checkGraalVersion() {
final String graalVersion = System.getProperty("graal.version", "unknown");
final String expectedGraalVersion = "0.4";

if (graalVersion.equals("unknown")) {
return;
} else if (!graalVersion.equals(expectedGraalVersion)) {
throw new RuntimeException("This version of JRuby is built against Graal " + expectedGraalVersion + " but you are using it with version " + graalVersion + " - either update Graal or use with (-J)-original to disable Graal and ignore this error");
if (Options.TRUFFLE_RUNTIME_VERSION_CHECK.load()) {
final String graalVersion = System.getProperty("graal.version", "unknown");
final String expectedGraalVersion = "0.4";

if (graalVersion.equals("unknown")) {
return;
} else if (!graalVersion.equals(expectedGraalVersion)) {
throw new RuntimeException("This version of JRuby is built against Graal " + expectedGraalVersion + " but you are using it with version " + graalVersion + " - either update Graal or use with (-J)-original to disable Graal and ignore this error");
}
}
}

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Expand Up @@ -128,6 +128,7 @@ public class Options {

public static final Option<Boolean> TRUFFLE_LOAD_CORE = bool(TRUFFLE, "truffle.load_core", true, "Load the Truffle core library.");
public static final Option<Boolean> TRUFFLE_PRINT_RUNTIME = bool(TRUFFLE, "truffle.printRuntime", false, "Print the name of the Truffle runtime on startup.");
public static final Option<Boolean> TRUFFLE_RUNTIME_VERSION_CHECK = bool(TRUFFLE, "truffle.runtime.version_check", true, "Check the version of Truffle supplied by the JVM before starting.");
public static final Option<Boolean> TRUFFLE_TRACE = bool(TRUFFLE, "truffle.trace", true, "Install trace probes needed for set_trace_func.");
public static final Option<Boolean> TRUFFLE_OBJECTSPACE = bool(TRUFFLE, "truffle.object_space", true, "Install safepoints needed for ObjectSpace.");
public static final Option<Boolean> TRUFFLE_EXCEPTIONS_PRINT_JAVA = bool(TRUFFLE, "truffle.exceptions.print_java", false, "Print Java exceptions at the point of translating them to Ruby exceptions.");
Expand Down

0 comments on commit 03e5101

Please sign in to comment.