Skip to content

Commit

Permalink
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
@@ -380,6 +380,7 @@ private void processArgument() {
} else if (extendedOption.equals("+C") || extendedOption.equals("+CIR")) {
config.setCompileMode(RubyInstanceConfig.CompileMode.FORCE);
} else if (extendedOption.equals("+T")) {
checkGraalVersion();
Options.PARSER_WARN_GROUPED_EXPRESSIONS.force(Boolean.FALSE.toString());
config.setCompileMode(RubyInstanceConfig.CompileMode.TRUFFLE);
config.setDisableGems(true);
@@ -714,6 +715,18 @@ private void logScriptResolutionFailure(String path) {
}
}

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

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");
}
}

private static final Set<String> KNOWN_PROPERTIES = new HashSet<>();

static {

0 comments on commit 04cf44a

Please sign in to comment.