Skip to content

Commit

Permalink
JVM standalones without LibGraal should include the Graal compiler.
Browse files Browse the repository at this point in the history
When it is selected as one of the components.
  • Loading branch information
ansalond committed Feb 27, 2024
1 parent 4b89ff9 commit 904a7c5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sdk/mx.sdk/mx_sdk_vm_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3575,8 +3575,18 @@ def register_main_dist(dist, label):
register_main_dist(native_standalone, 'graalvm_standalones')

if needs_java_standalone_jimage:
has_lib_graal = _get_libgraal_component() is not None
components_with_jimage_jars = GraalVmStandaloneComponent.default_jvm_components()
if not has_lib_graal:
cmpee = get_component('cmpee', fatalIfMissing=False, stage1=False)
if cmpee is not None:
components_with_jimage_jars += [cmpee]
else:
cmp = get_component('cmp', fatalIfMissing=False, stage1=False)
if cmp is not None:
components_with_jimage_jars += [cmp]
java_standalone_jimage_jars = set()
for component in GraalVmLayoutDistribution._add_dependencies(GraalVmStandaloneComponent.default_jvm_components()):
for component in GraalVmLayoutDistribution._add_dependencies(components_with_jimage_jars):
java_standalone_jimage_jars.update(component.boot_jars + component.jvmci_parent_jars)
if isinstance(component, mx_sdk.GraalVmJvmciComponent):
java_standalone_jimage_jars.update(component.jvmci_jars)
Expand All @@ -3588,7 +3598,7 @@ def register_main_dist(dist, label):
workingSets=None,
defaultBuild=False,
missing_export_target_action='warn',
default_to_jvmci='lib' if _get_libgraal_component() is not None else False,
default_to_jvmci='lib' if has_lib_graal else False,
)
register_project(java_standalone_jimage)

Expand Down

0 comments on commit 904a7c5

Please sign in to comment.