Skip to content

Commit d440623

Browse files
committed
[GR-65404] Remove PolyglotLauncher
1 parent 312c2b4 commit d440623

File tree

7 files changed

+14
-655
lines changed

7 files changed

+14
-655
lines changed

sdk/mx.sdk/mx_sdk_vm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@
8282

8383

8484
class AbstractNativeImageConfig(object, metaclass=ABCMeta):
85-
def __init__(self, destination, jar_distributions, build_args, use_modules=None, links=None, is_polyglot=False, dir_jars=False, home_finder=False, build_time=1, build_args_enterprise=None): # pylint: disable=super-init-not-called
85+
def __init__(self, destination, jar_distributions, build_args, use_modules=None, links=None, dir_jars=False, home_finder=False, build_time=1, build_args_enterprise=None): # pylint: disable=super-init-not-called
8686
"""
8787
:type destination: str
8888
:type jar_distributions: list[str]
8989
:type build_args: list[str]
9090
:param str | None use_modules: Run (with 'launcher') or run and build image with module support (with 'image').
9191
:type links: list[str] | None
92-
:type is_polyglot: bool
9392
:param bool dir_jars: If true, all jars in the component directory are added to the classpath.
9493
:type home_finder: bool
9594
:type build_time: int
@@ -100,7 +99,6 @@ def __init__(self, destination, jar_distributions, build_args, use_modules=None,
10099
self.build_args = build_args
101100
self.use_modules = use_modules
102101
self.links = [mx_subst.path_substitutions.substitute(link) for link in links] if links else []
103-
self.is_polyglot = is_polyglot
104102
self.dir_jars = dir_jars
105103
self.home_finder = home_finder
106104
self.build_time = build_time
@@ -184,7 +182,7 @@ def __init__(self, destination, jar_distributions, main_class, build_args, langu
184182
:param str language
185183
"""
186184
super(LanguageLauncherConfig, self).__init__(destination, jar_distributions, main_class, build_args,
187-
is_sdk_launcher=is_sdk_launcher, is_polyglot=False, **kwargs)
185+
is_sdk_launcher=is_sdk_launcher, **kwargs)
188186
self.language = language
189187

190188
# Ensure the language launcher can always find the language home

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ def _get_main_module():
20152015
def _get_extra_jvm_args():
20162016
image_config = self.subject.native_image_config
20172017
extra_jvm_args = mx.list_to_cmd_line(image_config.extra_jvm_args)
2018-
if isinstance(self.subject.component, mx_sdk.GraalVmTruffleComponent) or image_config.is_polyglot:
2018+
if isinstance(self.subject.component, mx_sdk.GraalVmTruffleComponent):
20192019
extra_jvm_args = ' '.join([extra_jvm_args, '--enable-native-access=org.graalvm.truffle'])
20202020
# GR-59703: Migrate sun.misc.* usages.
20212021
if mx.VersionSpec("23.0.0") <= mx.get_jdk(tag='default').version:
@@ -2194,8 +2194,6 @@ def get_build_args(self):
21942194
] + svm_experimental_options(experimental_build_args) + [
21952195
'--macro:' + GraalVmNativeProperties.macro_name(self.subject.native_image_config), # last to allow overrides
21962196
]
2197-
if self.subject.native_image_config.is_polyglot:
2198-
build_args += ["--macro:truffle", "--language:all"]
21992197
return build_args
22002198

22012199

sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/AbstractLanguageLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ final void launch(List<String> args, Map<String, String> defaultOptions, boolean
280280

281281
if (isAOT() && doNativeSetup && !IS_LIBPOLYGLOT) {
282282
assert nativeAccess != null;
283-
maybeExec(originalArgs, unrecognizedArgs, false, getDefaultVMType(), jniLaunch);
283+
maybeExec(originalArgs, unrecognizedArgs, getDefaultVMType(), jniLaunch);
284284
}
285285

286286
parseUnrecognizedOptions(getLanguageId(), polyglotOptions, unrecognizedArgs);

sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/LanguageLauncherBase.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -171,10 +171,6 @@ final boolean isPolyglot() {
171171
return seenPolyglot;
172172
}
173173

174-
final void setPolyglot(boolean polyglot) {
175-
seenPolyglot = polyglot;
176-
}
177-
178174
final void setupContextBuilder(Context.Builder builder) {
179175
Path logFile = getLogFile();
180176
if (logFile != null) {

sdk/src/org.graalvm.launcher/src/org/graalvm/launcher/Launcher.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -1215,14 +1215,14 @@ protected static String getProgramName() {
12151215
@SuppressWarnings("unused")
12161216
@Deprecated(since = "20.3")
12171217
protected final void maybeNativeExec(List<String> args, boolean isPolyglotLauncher, Map<String, String> polyglotOptions) {
1218-
maybeNativeExec(args, args, isPolyglotLauncher);
1218+
maybeNativeExec(args, args, false);
12191219
}
12201220

12211221
/**
12221222
* Possibly re-executes the launcher when JVM or polyglot mode is requested; call only if
12231223
* {@link #isAOT()} is true. If the result is to run native, then it applies VM options on the
12241224
* current process.
1225-
*
1225+
* <p>
12261226
* The method parses the {@code unrecognizedArgs} for --jvm/--native/--polyglot flags and --vm.*
12271227
* options. If JVM mode is requested, it execs a Java process configured with supported JVM
12281228
* parameters and system properties over this process - in this case, the method does not return
@@ -1232,17 +1232,17 @@ protected final void maybeNativeExec(List<String> args, boolean isPolyglotLaunch
12321232
* @param unrecognizedArgs a subset of {@code originalArgs} that was not recognized by
12331233
* {@link AbstractLanguageLauncher#preprocessArguments(List, Map)}. All arguments
12341234
* recognized by maybeExec are removed from the list.
1235-
* @param isPolyglotLauncher whether this is the {@link PolyglotLauncher} (bin/polyglot)
1235+
* @param isPolyglotLauncher no longer used, always false
12361236
* @since 20.0
12371237
*/
1238-
protected final void maybeNativeExec(List<String> originalArgs, List<String> unrecognizedArgs, boolean isPolyglotLauncher) {
1238+
protected final void maybeNativeExec(List<String> originalArgs, List<String> unrecognizedArgs, @SuppressWarnings("unused") boolean isPolyglotLauncher) {
12391239
if (!IS_AOT) {
12401240
return;
12411241
}
1242-
maybeExec(originalArgs, unrecognizedArgs, isPolyglotLauncher, getDefaultVMType(), false);
1242+
maybeExec(originalArgs, unrecognizedArgs, getDefaultVMType(), false);
12431243
}
12441244

1245-
void maybeExec(List<String> originalArgs, List<String> unrecognizedArgs, boolean isPolyglotLauncher, VMType defaultVmType, boolean thinLauncher) {
1245+
void maybeExec(List<String> originalArgs, List<String> unrecognizedArgs, VMType defaultVmType, boolean thinLauncher) {
12461246
assert isAOT();
12471247
VMType vmType = null;
12481248
boolean polyglot = false;
@@ -1299,7 +1299,7 @@ void maybeExec(List<String> originalArgs, List<String> unrecognizedArgs, boolean
12991299
jvmArgs.add('-' + vmOption);
13001300
}
13011301

1302-
if (!isPolyglotLauncher && polyglot) {
1302+
if (polyglot) {
13031303
applicationArgs.add(0, "--polyglot");
13041304
}
13051305
assert !isStandalone();
@@ -1329,7 +1329,7 @@ void maybeExec(List<String> originalArgs, List<String> unrecognizedArgs, boolean
13291329
*/
13301330
VMRuntime.initialize();
13311331

1332-
if (!isPolyglotLauncher && polyglot) {
1332+
if (polyglot) {
13331333
assert jvmArgs.isEmpty();
13341334
if (isStandalone()) {
13351335
throw abort("--polyglot option is only supported when this launcher is part of a GraalVM.");

0 commit comments

Comments
 (0)