Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4d3d1528f4ef
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: af87bdf77b79
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 12, 2016

  1. Copy the full SHA
    56dc684 View commit details
  2. [Truffle] Setup JRUBY_HOME even if it was not passed in options.

    * For instance, creating just a PolyglotEngine without configuration does that.
    eregon committed Dec 12, 2016
    Copy the full SHA
    af87bdf View commit details
Showing with 19 additions and 10 deletions.
  1. +1 −1 tool/jt.rb
  2. +18 −9 truffle/src/main/java/org/jruby/truffle/RubyContext.java
2 changes: 1 addition & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -1062,7 +1062,7 @@ def test_specs(command, *args)
private :test_specs

def test_tck(*args)
exec 'mx', 'rubytck' if Utilities.mx?
raw_sh 'mx', 'rubytck', use_exec: true if Utilities.mx?
env = {'JRUBY_BUILD_MORE_QUIET' => 'true'}
mvn env, *args, '-Ptck'
end
27 changes: 18 additions & 9 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ public RubyContext(TruffleLanguage.Env env) {
optionsBuilder.set(System.getProperties());
options = optionsBuilder.build();

this.jrubyHome = setupJRubyHome();
this.jrubyHome = findJRubyHome();
this.currentDirectory = System.getProperty("user.dir");

if (options.CALL_GRAPH) {
@@ -207,11 +207,6 @@ public RubyContext(TruffleLanguage.Env env) {
}
}

private String setupJRubyHome() {
String jrubyHome = findJRubyHome();
return jrubyHome;
}

private CodeSource getCodeSource() {
try {
return Class.forName("org.jruby.Ruby").getProtectionDomain().getCodeSource();
@@ -221,8 +216,22 @@ private CodeSource getCodeSource() {
}

private String findJRubyHome() {
if (!TruffleOptions.AOT && System.getenv("JRUBY_HOME") == null && System.getProperty("jruby.home") == null) {
// Set JRuby home automatically for GraalVM
if (options.HOME != null) {
return options.HOME;
}

String fromENV = System.getenv("JRUBY_HOME");
if (fromENV != null) {
return fromENV;
}

String fromProperty = System.getProperty("jruby.home");
if (fromProperty != null) {
return fromProperty;
}

if (!TruffleOptions.AOT) {
// Set JRuby home automatically for GraalVM and mx from the current jar path
final CodeSource codeSource = getCodeSource();
if (codeSource != null) {
final File currentJarFile;
@@ -252,7 +261,7 @@ private String findJRubyHome() {
}
}

return options.HOME;
return null;
}

public Object send(Object object, String methodName, DynamicObject block, Object... arguments) {