Skip to content

Commit 89d126a

Browse files
ansalondgilles-duboscq
authored andcommitted
[GR-45794] Introduce component dependencies for EE standalones.
PullRequest: graal/14728
2 parents 538dd6e + 427d7af commit 89d126a

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

ci_includes/publish-javadoc.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252

5353
local all_builds = [
54-
# common.post_merge + linux_amd64 + common.labsjdk17 + javadoc_publisher,
54+
common.post_merge + linux_amd64 + common.labsjdk17 + javadoc_publisher,
5555
],
5656
// adds a "defined_in" field to all builds mentioning the location of this current file
5757
builds:: [{ defined_in: std.thisFile } + b for b in all_builds]

sdk/mx.sdk/mx_sdk_vm.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,20 +371,24 @@ def direct_dependencies(self):
371371

372372
class GraalVmTruffleComponent(GraalVmComponent):
373373
def __init__(self, suite, name, short_name, license_files, third_party_license_files, truffle_jars,
374-
include_in_polyglot=None, standalone_dir_name=None, standalone_dependencies=None, **kwargs):
374+
include_in_polyglot=None, standalone_dir_name=None, standalone_dependencies=None,
375+
standalone_dependencies_enterprise=None, **kwargs):
375376
"""
376377
:param list[str] truffle_jars: JAR distributions that should be on the classpath for the language implementation.
377378
:param bool include_in_polyglot: whether this component is included in `--language:all` or `--tool:all` and should be part of polyglot images (deprecated).
378379
:param str standalone_dir_name: name for the standalone archive and directory inside
379-
:param dict[str, (str, list[str])] standalone_dependencies: dict of dependent components to include in the standalone in the form {component name: (relative path, excluded_paths)}.
380+
:param dict[str, (str, list[str])] standalone_dependencies: dict of dependent components to include in the CE standalone in the form {component name: (relative path, excluded_paths)}.
381+
:param dict[str, (str, list[str])] standalone_dependencies_enterprise: like `standalone_dependencies`, but for the EE standalone. Defaults to `standalone_dependencies` if not set.
380382
"""
381383
super(GraalVmTruffleComponent, self).__init__(suite, name, short_name, license_files, third_party_license_files,
382384
jar_distributions=truffle_jars, **kwargs)
383385
if include_in_polyglot is not None:
384386
mx.warn('"include_in_polyglot" is deprecated. Please drop all uses.')
385387
self.standalone_dir_name = standalone_dir_name or '{}-<version>-<graalvm_os>-<arch>'.format(self.dir_name)
386388
self.standalone_dependencies = standalone_dependencies or {}
389+
self.standalone_dependencies_enterprise = standalone_dependencies_enterprise or self.standalone_dependencies
387390
assert isinstance(self.standalone_dependencies, dict)
391+
assert isinstance(self.standalone_dependencies_enterprise, dict)
388392

389393

390394
class GraalVmLanguage(GraalVmTruffleComponent):

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,16 +1131,22 @@ def remove_lib_prefix_suffix(libname, require_suffix_prefix=True):
11311131
class SvmSupport(object):
11321132
def __init__(self):
11331133
self._svm_supported = has_component('svm', stage1=True)
1134+
self._svm_ee_supported = self._svm_supported and has_component('svmee', stage1=True)
11341135
self._debug_supported = self._svm_supported and (mx.is_linux() or mx.is_windows() or (mx.is_darwin() and has_component('svmee', stage1=True)))
11351136
self._separate_debuginfo_ext = {
11361137
'linux': '.debug',
11371138
'windows': '.pdb',
11381139
}.get(mx.get_os(), None)
1139-
self._pgo_supported = self._svm_supported and has_component('svmee', stage1=True)
11401140

11411141
def is_supported(self):
11421142
return self._svm_supported
11431143

1144+
def is_ee_supported(self):
1145+
return self._svm_ee_supported
1146+
1147+
def is_pgo_supported(self):
1148+
return self.is_ee_supported()
1149+
11441150
def native_image(self, build_args, output_file, allow_server=False, nonZeroIsFatal=True, out=None, err=None):
11451151
assert self._svm_supported
11461152
stage1 = get_stage1_graalvm_distribution()
@@ -1165,9 +1171,6 @@ def generate_separate_debug_info(self, image_config):
11651171
def separate_debuginfo_ext(self):
11661172
return self._separate_debuginfo_ext
11671173

1168-
def is_pgo_supported(self):
1169-
return self._pgo_supported
1170-
11711174
def get_debug_flags(self, image_config):
11721175
assert self.is_debug_supported()
11731176
flags = ['-g']
@@ -2645,12 +2648,14 @@ def require_svm(components):
26452648
"""
26462649
return any(_get_launcher_configs(comp) or _get_library_configs(comp) for comp in components)
26472650

2651+
svm_support = _get_svm_support()
26482652
other_comp_names = []
2649-
self.involved_components = [component] + [get_component(dep) for dep in component.standalone_dependencies]
2650-
if _get_svm_support().is_supported() and require_svm(self.involved_components):
2651-
if 'svm' in [c.short_name for c in registered_graalvm_components(stage1=True)]:
2653+
dependencies = component.standalone_dependencies_enterprise if svm_support.is_ee_supported() else component.standalone_dependencies
2654+
self.involved_components = [component] + [get_component(dep) for dep in dependencies]
2655+
if require_svm(self.involved_components):
2656+
if svm_support.is_supported():
26522657
other_comp_names.append('svm')
2653-
if 'svmee' in [c.short_name for c in registered_graalvm_components(stage1=True)]:
2658+
if svm_support.is_ee_supported():
26542659
other_comp_names.append('svmee')
26552660
for _component in self.involved_components:
26562661
other_comp_names += _component.extra_installable_qualifiers
@@ -2666,7 +2671,7 @@ def require_svm(components):
26662671

26672672
# Compute paths from standalone component launchers to other homes
26682673
home_paths = {}
2669-
for dependency_name, details in component.standalone_dependencies.items():
2674+
for dependency_name, details in dependencies.items():
26702675
dependency_path = details[0]
26712676
comp = get_component(dependency_name, fatalIfMissing=True)
26722677
home_paths[comp.installable_id] = base_dir + dependency_path
@@ -2753,7 +2758,7 @@ def add_files_from_component(comp, path_prefix, excluded_paths):
27532758
metadata = BaseGraalVmLayoutDistribution._get_metadata(sorted_suites)
27542759
layout.setdefault(base_dir + 'release', []).append('string:' + metadata)
27552760

2756-
for dependency_name, details in component.standalone_dependencies.items():
2761+
for dependency_name, details in dependencies.items():
27572762
dependency_path = details[0]
27582763
excluded_paths = details[1] if len(details) > 1 else []
27592764
dependency = get_component(dependency_name, fatalIfMissing=True)
@@ -3120,15 +3125,17 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi
31203125
# Create standalones
31213126
for components in installables.values():
31223127
main_component = _get_main_component(components)
3128+
svm_support = _get_svm_support()
31233129
if main_component.standalone and isinstance(main_component, mx_sdk.GraalVmTruffleComponent):
31243130
only_native_launchers = not main_component.launcher_configs or has_svm_launcher(main_component)
3125-
only_native_libraries = not main_component.library_configs or (_get_svm_support().is_supported() and not _has_skipped_libraries(main_component))
3131+
only_native_libraries = not main_component.library_configs or (svm_support.is_supported() and not _has_skipped_libraries(main_component))
31263132
if only_native_launchers and only_native_libraries:
3127-
dependencies = main_component.standalone_dependencies.keys()
3128-
missing_dependencies = [dep for dep in dependencies if not has_component(dep) or _has_skipped_libraries(get_component(dep)) or (get_component(dep).library_configs and not _get_svm_support().is_supported())]
3129-
if missing_dependencies:
3133+
dependencies = main_component.standalone_dependencies_enterprise if svm_support.is_ee_supported() else main_component.standalone_dependencies
3134+
dependency_names = dependencies.keys()
3135+
missing_dependency_names = [dep for dep in dependency_names if not has_component(dep) or _has_skipped_libraries(get_component(dep)) or (get_component(dep).library_configs and not svm_support.is_supported())]
3136+
if missing_dependency_names:
31303137
if mx.get_opts().verbose:
3131-
mx.warn("Skipping standalone {} because the components {} are excluded".format(main_component.name, missing_dependencies))
3138+
mx.warn("Skipping standalone {} because the components {} are excluded".format(main_component.name, missing_dependency_names))
31323139
else:
31333140
standalone = GraalVmStandaloneComponent(get_component(main_component.name, fatalIfMissing=True), _final_graalvm_distribution)
31343141
register_distribution(standalone)

vm/mx.vm/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
{
5959
"name": "truffleruby",
60-
"version": "6ccde34aa2356355f58be836b0b020ec613a9cd7",
60+
"version": "bd96fa823c214a04a5586c230e07671fd41bb0de",
6161
"dynamic": True,
6262
"urls": [
6363
{"url": "https://github.com/oracle/truffleruby.git", "kind": "git"},
@@ -75,7 +75,7 @@
7575
},
7676
{
7777
"name": "graalpython",
78-
"version": "27aa283a257279e4023b1ffa91814dc7eb21cb0a",
78+
"version": "2a66249267559672b69384f9e030d288a694c12a",
7979
"dynamic": True,
8080
"urls": [
8181
{"url": "https://github.com/graalvm/graalpython.git", "kind": "git"},

0 commit comments

Comments
 (0)