Skip to content

Commit 2855d3e

Browse files
committed
Simplify setting the launcher option now that it's only set for native
1 parent 1e3f4c0 commit 2855d3e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/launcher/java/org/truffleruby/launcher/RubyLauncher.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ protected List<String> preprocessArguments(List<String> args, Map<String, String
101101
config.appendOptionValue(OptionsCatalog.LOAD_PATHS, path);
102102
}
103103

104-
if (isAOT()) {
105-
setRubyLauncher();
106-
}
107-
108104
} catch (CommandLineException commandLineException) {
109105
System.err.println(TruffleRuby.SIMPLE_NAME + ": " + commandLineException.getMessage());
110106
if (commandLineException.isUsageError()) {
@@ -245,6 +241,11 @@ private static void debugPreInitialization() {
245241
}
246242

247243
private Context createContext(Context.Builder builder, CommandLineOptions config) {
244+
if (isAOT()) {
245+
final String launcher = ProcessProperties.getExecutableName();
246+
builder.option(OptionsCatalog.LAUNCHER.getName(), launcher);
247+
}
248+
248249
if (!config.isSetInPolyglotOptions(OptionsCatalog.EMBEDDED.getName())) {
249250
builder.option(OptionsCatalog.EMBEDDED.getName(), "false");
250251
}
@@ -275,15 +276,6 @@ private static List<String> getPathListFromEnvVariable(String name) {
275276
return Collections.emptyList();
276277
}
277278

278-
private String setRubyLauncher() {
279-
if (String.class.cast(config.getOption(OptionsCatalog.LAUNCHER)).isEmpty()) {
280-
final String launcher = ProcessProperties.getExecutableName();
281-
config.setOption(OptionsCatalog.LAUNCHER, launcher);
282-
return launcher;
283-
}
284-
return null;
285-
}
286-
287279
private static void printPreRunInformation(CommandLineOptions config) {
288280
if (config.showVersion) {
289281
System.out.println(TruffleRuby.getVersionString(getImplementationNameFromEngine(), isAOT()));

0 commit comments

Comments
 (0)