@@ -61,7 +61,15 @@ protected void printVersion() {
61
61
62
62
@ Override
63
63
protected List <String > preprocessArguments (List <String > args , Map <String , String > polyglotOptions ) {
64
- config = new CommandLineOptions (polyglotOptions );
64
+ // Set default options for the launcher which don't match the OptionKey's default.
65
+ // These options can still be overridden if set explicitly.
66
+ polyglotOptions .put (OptionsCatalog .EMBEDDED .getName (), "false" );
67
+ if (isAOT ()) {
68
+ final String launcher = ProcessProperties .getExecutableName ();
69
+ polyglotOptions .put (OptionsCatalog .LAUNCHER .getName (), launcher );
70
+ }
71
+
72
+ config = new CommandLineOptions ();
65
73
66
74
try {
67
75
config .executionAction = ExecutionAction .UNSET ;
@@ -236,15 +244,6 @@ private int runRubyMain(Context.Builder contextBuilder, CommandLineOptions confi
236
244
}
237
245
238
246
private Context createContext (Context .Builder builder , CommandLineOptions config ) {
239
- if (isAOT () && !config .isSetInPolyglotOptions (OptionsCatalog .LAUNCHER .getName ())) {
240
- final String launcher = ProcessProperties .getExecutableName ();
241
- builder .option (OptionsCatalog .LAUNCHER .getName (), launcher );
242
- }
243
-
244
- if (!config .isSetInPolyglotOptions (OptionsCatalog .EMBEDDED .getName ())) {
245
- builder .option (OptionsCatalog .EMBEDDED .getName (), "false" );
246
- }
247
-
248
247
if (config .isGemOrBundle () && getImplementationNameFromEngine ().contains ("Graal" )) {
249
248
// Apply options to run gem/bundle more efficiently
250
249
builder .option ("engine.Mode" , "latency" );
0 commit comments