Skip to content

Commit 83f9932

Browse files
committed
[GR-51274] Backport removal of the GraalVM Component Updater (gu) and the installables.
PullRequest: graal/17038
2 parents 812049f + 0ded87c commit 83f9932

File tree

462 files changed

+56
-64180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

462 files changed

+56
-64180
lines changed

Diff for: sdk/mx.sdk/mx_sdk_vm_impl.py

+3-230
Original file line numberDiff line numberDiff line change
@@ -765,28 +765,6 @@ def _add_link(_dest, _target, _component=None, _dest_base_name=None):
765765
graalvm_dists.difference_update(component_dists)
766766
_add(layout, '<jre_base>/lib/graalvm/', ['dependency:' + d for d in sorted(graalvm_dists)], with_sources=True)
767767

768-
if mx.suite('vm', fatalIfMissing=False):
769-
import mx_vm
770-
installer_components_dir = _get_component_type_base(mx_vm.gu_component) + mx_vm.gu_component.dir_name + '/components/'
771-
if not is_graalvm or get_component(mx_vm.gu_component.short_name, stage1=stage1):
772-
# Execute the following code if this is not a GraalVM distribution (e.g., is an installable) or if the
773-
# GraalVM distribution includes `gu`.
774-
#
775-
# Register pre-installed components
776-
for installable_components in installable_component_lists.values():
777-
manifest_str = _gen_gu_manifest(installable_components, _format_properties, bundled=True)
778-
main_component = _get_main_component(installable_components)
779-
mx.logv("Adding gu metadata for{}installable '{}'".format(' disabled ' if _disable_installable(main_component) else ' ', main_component.installable_id))
780-
_add(layout, installer_components_dir + 'org.graalvm.' + main_component.installable_id + '.component', "string:" + manifest_str)
781-
# Register Core
782-
manifest_str = _format_properties({
783-
"Bundle-Name": "GraalVM Core",
784-
"Bundle-Symbolic-Name": "org.graalvm",
785-
"Bundle-Version": _suite.release_version(),
786-
"x-GraalVM-Stability-Level": _get_core_stability(),
787-
})
788-
_add(layout, installer_components_dir + 'org.graalvm.component', "string:" + manifest_str)
789-
790768
for _base, _suites in component_suites.items():
791769
_metadata = self._get_metadata(_suites)
792770
_add(layout, _base + 'release', "string:{}".format(_metadata))
@@ -857,26 +835,6 @@ def _get_metadata(suites, parent_release_file=None):
857835
_source += ' '.join(['{}:{}'.format(_s.name, _s.version()) for _s in suites])
858836
_metadata_dict['SOURCE'] = _source
859837
_metadata_dict['COMMIT_INFO'] = json.dumps(_commit_info, sort_keys=True)
860-
if _suite.is_release():
861-
catalog = _release_catalog()
862-
gds_product_id = _release_product_id()
863-
else:
864-
snapshot_catalog = _snapshot_catalog()
865-
gds_product_id = _snapshot_product_id()
866-
gds_snapshot_catalog = _gds_snapshot_catalog()
867-
if snapshot_catalog and _suite.vc:
868-
catalog = "{}/{}".format(snapshot_catalog, _suite.vc.parent(_suite.vc_dir))
869-
if gds_snapshot_catalog:
870-
catalog += "|" + gds_snapshot_catalog
871-
elif gds_snapshot_catalog:
872-
catalog = gds_snapshot_catalog
873-
else:
874-
catalog = None
875-
if USE_LEGACY_GU:
876-
if catalog:
877-
_metadata_dict['component_catalog'] = catalog
878-
if gds_product_id:
879-
_metadata_dict['GDS_PRODUCT_ID'] = gds_product_id
880838

881839
# COMMIT_INFO is unquoted to simplify JSON parsing
882840
return mx_sdk_vm.format_release_file(_metadata_dict, {'COMMIT_INFO'})
@@ -2624,148 +2582,6 @@ def _gen_gu_manifest(components, formatter, bundled=False):
26242582
return formatter(manifest)
26252583

26262584

2627-
class InstallableComponentArchiver(mx.Archiver):
2628-
def __init__(self, path, components, **kw_args):
2629-
"""
2630-
:type path: str
2631-
:type components: list[mx_sdk.GraalVmLanguage]
2632-
:type kind: str
2633-
:type reset_user_group: bool
2634-
:type duplicates_action: str
2635-
:type context: object
2636-
"""
2637-
super(InstallableComponentArchiver, self).__init__(path, **kw_args)
2638-
self.components = components
2639-
self.permissions = []
2640-
self.symlinks = []
2641-
2642-
@staticmethod
2643-
def _perm_str(filename):
2644-
_perm = str(oct(os.lstat(filename).st_mode)[-3:])
2645-
_str = ''
2646-
for _p in _perm:
2647-
if _p == '7':
2648-
_str += 'rwx'
2649-
elif _p == '6':
2650-
_str += 'rw-'
2651-
elif _p == '5':
2652-
_str += 'r-x'
2653-
elif _p == '4':
2654-
_str += 'r--'
2655-
elif _p == '0':
2656-
_str += '---'
2657-
else:
2658-
mx.abort('File {} has unsupported permission {}'.format(filename, _perm))
2659-
return _str
2660-
2661-
def add(self, filename, archive_name, provenance):
2662-
self.permissions.append('{} = {}'.format(archive_name, self._perm_str(filename)))
2663-
super(InstallableComponentArchiver, self).add(filename, archive_name, provenance)
2664-
2665-
def add_str(self, data, archive_name, provenance):
2666-
self.permissions.append('{} = {}'.format(archive_name, 'rw-rw-r--'))
2667-
super(InstallableComponentArchiver, self).add_str(data, archive_name, provenance)
2668-
2669-
def add_link(self, target, archive_name, provenance):
2670-
self.permissions.append('{} = {}'.format(archive_name, 'rwxrwxrwx'))
2671-
self.symlinks.append('{} = {}'.format(archive_name, target))
2672-
# do not add symlinks, use the metadata to create them
2673-
2674-
def __exit__(self, exc_type, exc_value, traceback):
2675-
assert self.components[0] == _get_main_component(self.components)
2676-
_manifest_str_wrapped = _gen_gu_manifest(self.components, _format_manifest)
2677-
_manifest_arc_name = 'META-INF/MANIFEST.MF'
2678-
2679-
_permissions_str = '\n'.join(self.permissions)
2680-
_permissions_arc_name = 'META-INF/permissions'
2681-
2682-
_symlinks_str = '\n'.join(self.symlinks)
2683-
_symlinks_arc_name = 'META-INF/symlinks'
2684-
2685-
for _str, _arc_name in [(_manifest_str_wrapped, _manifest_arc_name), (_permissions_str, _permissions_arc_name),
2686-
(_symlinks_str, _symlinks_arc_name)]:
2687-
self.add_str(_str, _arc_name, '{}<-string:{}'.format(_arc_name, _str))
2688-
2689-
super(InstallableComponentArchiver, self).__exit__(exc_type, exc_value, traceback)
2690-
2691-
2692-
class GraalVmInstallableComponent(BaseGraalVmLayoutDistribution, mx.LayoutJARDistribution): # pylint: disable=R0901
2693-
def __init__(self, component, extra_components=None, **kw_args):
2694-
"""
2695-
:type component: mx_sdk.GraalVmComponent
2696-
"""
2697-
self.main_component = component
2698-
2699-
def create_archive(path, **_kw_args):
2700-
return InstallableComponentArchiver(path, self.components, **_kw_args)
2701-
2702-
launcher_configs = list(_get_launcher_configs(component))
2703-
for component_ in extra_components:
2704-
launcher_configs += _get_launcher_configs(component_)
2705-
2706-
library_configs = list(_get_library_configs(component))
2707-
for component_ in extra_components:
2708-
library_configs += _get_library_configs(component_)
2709-
2710-
extra_installable_qualifiers = list(component.extra_installable_qualifiers)
2711-
for component_ in extra_components:
2712-
extra_installable_qualifiers += component_.extra_installable_qualifiers
2713-
2714-
other_involved_components = []
2715-
if self.main_component.short_name not in ('svm', 'svmee') \
2716-
and _get_svm_support().is_supported() \
2717-
and (
2718-
any(not _force_bash_launchers(lc) for lc in launcher_configs) or
2719-
any(not _skip_libraries(lc) for lc in library_configs)):
2720-
other_involved_components += [c for c in registered_graalvm_components(stage1=True) if c.short_name in ('svm', 'svmee')]
2721-
2722-
name = '{}_INSTALLABLE'.format(component.installable_id.replace('-', '_').upper())
2723-
for library_config in library_configs:
2724-
if _skip_libraries(library_config):
2725-
name += '_S' + basename(library_config.destination).upper()
2726-
if other_involved_components:
2727-
extra_installable_qualifiers += [c.short_name for c in other_involved_components]
2728-
if not extra_installable_qualifiers:
2729-
extra_installable_qualifiers = mx_sdk_vm.extra_installable_qualifiers(mx_sdk_vm.base_jdk().home, ['ce'], None)
2730-
if extra_installable_qualifiers:
2731-
name += '_' + '_'.join(sorted(q.upper() for q in extra_installable_qualifiers))
2732-
name += '_JAVA{}'.format(_src_jdk_version)
2733-
2734-
for component_ in [component] + extra_components:
2735-
for boot_jar in component_.boot_jars:
2736-
mx.warn("Component '{}' declares '{}' as 'boot_jar', which is ignored by the build process of the '{}' installable".format(component_.name, boot_jar, name))
2737-
2738-
self.maven = _graalvm_maven_attributes(tag='installable')
2739-
components = [component]
2740-
if extra_components:
2741-
components += extra_components
2742-
super(GraalVmInstallableComponent, self).__init__(
2743-
suite=_suite,
2744-
name=name,
2745-
deps=[],
2746-
components=components,
2747-
is_graalvm=False,
2748-
exclLibs=[],
2749-
platformDependent=True,
2750-
theLicense=None,
2751-
testDistribution=False,
2752-
archive_factory=create_archive,
2753-
path=None,
2754-
include_native_image_resources_filelists=True,
2755-
**kw_args)
2756-
2757-
def get_artifact_metadata(self):
2758-
meta = super(GraalVmInstallableComponent, self).get_artifact_metadata()
2759-
meta.update({
2760-
'type': 'installable',
2761-
'installableName': self.main_component.installable_id.lower().replace('-', '_'),
2762-
'longName': self.main_component.name,
2763-
'stability': self.main_component.stability,
2764-
'symbolicName': 'org.graalvm.{}'.format(self.main_component.installable_id),
2765-
})
2766-
return meta
2767-
2768-
27692585
class GraalVmStandaloneComponent(LayoutSuper): # pylint: disable=R0901
27702586
def __init__(self, main_component, graalvm, is_jvm, **kw_args):
27712587
"""
@@ -3582,7 +3398,6 @@ def _release_version():
35823398
))
35833399
main_dists = {
35843400
'graalvm': [],
3585-
'graalvm_installables': [],
35863401
'graalvm_standalones': [],
35873402
}
35883403
with_non_rebuildable_configs = False
@@ -3699,12 +3514,6 @@ def register_main_dist(dist, label):
36993514
# Register main distribution
37003515
register_main_dist(_final_graalvm_distribution, 'graalvm')
37013516

3702-
# Register installables
3703-
for components in installables.values():
3704-
main_component = _get_main_component(components)
3705-
installable_component = GraalVmInstallableComponent(main_component, extra_components=[c for c in components if c != main_component])
3706-
register_main_dist(installable_component, 'graalvm_installables')
3707-
37083517
# Register standalones
37093518
needs_java_standalone_jimage = False
37103519
for components in installables.values():
@@ -3808,7 +3617,7 @@ def register_main_dist(dist, label):
38083617
jimage_project=final_jimage_project,
38093618
))
38103619

3811-
# Trivial distributions to trigger the build of the final GraalVM distribution, installables, and standalones
3620+
# Trivial distributions to trigger the build of the final GraalVM distribution and standalones
38123621
all_main_dists = []
38133622
for label, dists in main_dists.items():
38143623
if dists:
@@ -4287,7 +4096,7 @@ def graalvm_show(args, forced_graalvm_dist=None):
42874096

42884097
if forced_graalvm_dist is None:
42894098
# Custom GraalVM distributions with a forced component list do not yet support launchers and libraries.
4290-
# No installable or standalone is derived from them.
4099+
# No standalone is derived from them.
42914100
launchers = [p for p in _suite.projects if isinstance(p, GraalVmLauncher) and p.get_containing_graalvm() == graalvm_dist]
42924101
if launchers:
42934102
print("Launchers:")
@@ -4327,17 +4136,6 @@ def graalvm_show(args, forced_graalvm_dist=None):
43274136
else:
43284137
print("No library")
43294138

4330-
installables = _get_dists(GraalVmInstallableComponent)
4331-
if installables and not args.stage1:
4332-
print("Installables:")
4333-
for i in sorted(installables):
4334-
print(" - {}".format(i))
4335-
if args.verbose:
4336-
for c in i.components:
4337-
print(" - {}".format(c.name))
4338-
else:
4339-
print("No installable")
4340-
43414139
if not args.stage1:
43424140
jvm_standalones = []
43434141
native_standalones = []
@@ -4383,7 +4181,7 @@ def graalvm_show(args, forced_graalvm_dist=None):
43834181
for config in cfg['configs']:
43844182
print(f" {config} (from {cfg['source']})")
43854183
if args.verbose:
4386-
for dist_name in 'GRAALVM', 'GRAALVM_INSTALLABLES', 'GRAALVM_STANDALONES', 'ALL_GRAALVM_ARTIFACTS':
4184+
for dist_name in 'GRAALVM', 'GRAALVM_STANDALONES', 'ALL_GRAALVM_ARTIFACTS':
43874185
dist = mx.distribution(dist_name, fatalIfMissing=False)
43884186
if dist is not None:
43894187
print(f"Dependencies of the '{dist_name}' distribution:\n -", '\n - '.join(sorted(dep.name for dep in dist.deps)))
@@ -4517,11 +4315,6 @@ def graalvm_vendor_version():
45174315
mx.add_argument('--debuginfo-dists', action='store_true', help='Generate debuginfo distributions.')
45184316
mx.add_argument('--generate-debuginfo', action='store', help='Comma-separated list of launchers and libraries (syntax: lib:polyglot) for which to generate debug information (`native-image -g`) (all by default)', default=None)
45194317
mx.add_argument('--disable-debuginfo-stripping', action='store_true', help='Disable the stripping of debug symbols from the native image.')
4520-
mx.add_argument('--snapshot-catalog', action='store', help='Change the default URL of the component catalog for snapshots.', default=None)
4521-
mx.add_argument('--gds-snapshot-catalog', action='store', help='Change the default appended URL of the component catalog for snapshots.', default=None)
4522-
mx.add_argument('--release-catalog', action='store', help='Change the default URL of the component catalog for releases.', default=None)
4523-
mx.add_argument('--snapshot-product-id', action='store', help='Change the default ID of the GDS product ID for snapshots.', default=None)
4524-
mx.add_argument('--release-product-id', action='store', help='Change the default ID of the GDS product ID for releases.', default=None)
45254318
mx.add_argument('--extra-image-builder-argument', action='append', help='Add extra arguments to the image builder.', default=[])
45264319
mx.add_argument('--image-profile', action='append', help='Add a profile to be used while building a native image.', default=[])
45274320
mx.add_argument('--no-licenses', action='store_true', help='Do not add license files in the archives.')
@@ -4877,26 +4670,6 @@ def _rebuildable_image(image_config):
48774670
return name not in non_rebuildable
48784671

48794672

4880-
def _snapshot_catalog():
4881-
return mx.get_opts().snapshot_catalog or mx.get_env('SNAPSHOT_CATALOG')
4882-
4883-
4884-
def _gds_snapshot_catalog():
4885-
return mx.get_opts().gds_snapshot_catalog or mx.get_env('GDS_SNAPSHOT_CATALOG')
4886-
4887-
4888-
def _snapshot_product_id():
4889-
return mx.get_opts().snapshot_product_id or mx.get_env('SNAPSHOT_PRODUCT_ID')
4890-
4891-
4892-
def _release_catalog():
4893-
return mx.get_opts().release_catalog or mx.get_env('RELEASE_CATALOG')
4894-
4895-
4896-
def _release_product_id():
4897-
return mx.get_opts().release_product_id or mx.get_env('RELEASE_PRODUCT_ID')
4898-
4899-
49004673
def _base_jdk_info():
49014674
base_jdk_info = mx.get_opts().base_jdk_info or mx.get_env('BASE_JDK_INFO')
49024675
if base_jdk_info is None:

0 commit comments

Comments
 (0)