Skip to content

Commit e832ab8

Browse files
committed
[GR-13445] Adopt the new property for pre-initialization.
PullRequest: truffleruby/906
2 parents 9e8a50c + 5b1e3c3 commit e832ab8

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

doc/contributor/pre-initialization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Generator.
66
Context pre-initialization is enabled by setting this Java property:
77

88
```
9-
-Dpolyglot.engine.PreinitializeContexts=ruby
9+
-Dpolyglot.image-build-time.PreinitializeContexts=ruby
1010
```
1111

1212
This is enabled by default in `mx.truffleruby/native-image.properties`.
@@ -42,5 +42,5 @@ runtime execution.
4242
Debugging on the JVM can be achieved with:
4343

4444
```
45-
jt ruby --jvm --vm.Dpolyglot.engine.PreinitializeContexts=ruby --log.level=FINE -e 'p :hi'
45+
jt ruby --jvm --vm.Dpolyglot.image-build-time.PreinitializeContexts=ruby --log.level=FINE -e 'p :hi'
4646
```

mx.truffleruby/native-image.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Args = -H:MaxRuntimeCompileMethods=5400 \
88
-H:+AddAllCharsets \
99
--initialize-at-build-time=org.truffleruby,org.jcodings,org.joni,jline,org.fusesource
1010

11-
JavaArgs = -Dpolyglot.engine.PreinitializeContexts=ruby \
11+
JavaArgs = -Dpolyglot.image-build-time.PreinitializeContexts=ruby \
1212
-Dorg.graalvm.launcher.relative.llvm.home=../lib/cext/sulong-libs

mx.truffleruby/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "tools",
1010
"subdir": True,
1111
# version must always be equal to the version of the "sulong" import below
12-
"version": "0527e987ef67a1a93d14754becd2b3877d961b35",
12+
"version": "ce416312365c2756c02afe034173eee431003175",
1313
"urls": [
1414
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
1515
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},
@@ -19,7 +19,7 @@
1919
"name": "sulong",
2020
"subdir": True,
2121
# version must always be equal to the version of the "tools" import above
22-
"version": "0527e987ef67a1a93d14754becd2b3877d961b35",
22+
"version": "ce416312365c2756c02afe034173eee431003175",
2323
"urls": [
2424
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
2525
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},

src/main/java/org/truffleruby/RubyContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ private String searchRubyHome(Options options) throws IOException {
752752
final File launcherDir = canonicalLauncherPath.getParentFile();
753753
final File candidate = launcherDir == null ? null : launcherDir.getParentFile();
754754
RubyLanguage.LOGGER.config(() -> String.format("trying home %s guessed from executable %s, as the Ruby home", candidate, options.LAUNCHER));
755-
if (isRubyHome(candidate)) {
755+
if (candidate != null && isRubyHome(candidate)) {
756756
return candidate.getCanonicalPath();
757757
} else {
758758
RubyLanguage.LOGGER.warning(String.format("home %s guessed from executable %s does not look like TruffleRuby's home", candidate, options.LAUNCHER));

src/shared/java/org/truffleruby/shared/TruffleRuby.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class TruffleRuby {
2222
public static final int LANGUAGE_REVISION = BuildInformationImpl.INSTANCE.getRubyRevision();
2323
public static final String BOOT_SOURCE_NAME = "main_boot_source";
2424
public static final String RUBY_COPYRIGHT = "truffleruby - Copyright (c) 2013-2019 Oracle and/or its affiliates";
25-
public static final boolean PRE_INITIALIZE_CONTEXTS = System.getProperty("polyglot.engine.PreinitializeContexts") != null;
25+
public static final boolean PRE_INITIALIZE_CONTEXTS = System.getProperty("polyglot.image-build-time.PreinitializeContexts") != null;
2626

2727
public static String getVersionString(String implementationName, boolean isAOT) {
2828
final String vm;

0 commit comments

Comments
 (0)