Skip to content

Commit f1e8dc7

Browse files
committed
[GR-51274] Remove the GraalVM Component Updater (gu) and the installables.
PullRequest: graal/16864
2 parents 190bedc + 4567661 commit f1e8dc7

File tree

451 files changed

+49
-64211
lines changed

Some content is hidden

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

451 files changed

+49
-64211
lines changed

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 3 additions & 230 deletions
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'})
@@ -2636,148 +2594,6 @@ def _gen_gu_manifest(components, formatter, bundled=False):
26362594
return formatter(manifest)
26372595

26382596

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

3721-
# Register installables
3722-
for components in installables.values():
3723-
main_component = _get_main_component(components)
3724-
installable_component = GraalVmInstallableComponent(main_component, extra_components=[c for c in components if c != main_component])
3725-
register_main_dist(installable_component, 'graalvm_installables')
3726-
37273536
# Register standalones
37283537
needs_java_standalone_jimage = False
37293538
for components in installables.values():
@@ -3827,7 +3636,7 @@ def register_main_dist(dist, label):
38273636
jimage_project=final_jimage_project,
38283637
))
38293638

3830-
# Trivial distributions to trigger the build of the final GraalVM distribution, installables, and standalones
3639+
# Trivial distributions to trigger the build of the final GraalVM distribution and standalones
38313640
all_main_dists = []
38323641
for label, dists in main_dists.items():
38333642
if dists:
@@ -4306,7 +4115,7 @@ def graalvm_show(args, forced_graalvm_dist=None):
43064115

43074116
if forced_graalvm_dist is None:
43084117
# Custom GraalVM distributions with a forced component list do not yet support launchers and libraries.
4309-
# No installable or standalone is derived from them.
4118+
# No standalone is derived from them.
43104119
launchers = [p for p in _suite.projects if isinstance(p, GraalVmLauncher) and p.get_containing_graalvm() == graalvm_dist]
43114120
if launchers:
43124121
print("Launchers:")
@@ -4346,17 +4155,6 @@ def graalvm_show(args, forced_graalvm_dist=None):
43464155
else:
43474156
print("No library")
43484157

4349-
installables = _get_dists(GraalVmInstallableComponent)
4350-
if installables and not args.stage1:
4351-
print("Installables:")
4352-
for i in sorted(installables):
4353-
print(" - {}".format(i))
4354-
if args.verbose:
4355-
for c in i.components:
4356-
print(" - {}".format(c.name))
4357-
else:
4358-
print("No installable")
4359-
43604158
if not args.stage1:
43614159
jvm_standalones = []
43624160
native_standalones = []
@@ -4402,7 +4200,7 @@ def graalvm_show(args, forced_graalvm_dist=None):
44024200
for config in cfg['configs']:
44034201
print(f" {config} (from {cfg['source']})")
44044202
if args.verbose:
4405-
for dist_name in 'GRAALVM', 'GRAALVM_INSTALLABLES', 'GRAALVM_STANDALONES', 'ALL_GRAALVM_ARTIFACTS':
4203+
for dist_name in 'GRAALVM', 'GRAALVM_STANDALONES', 'ALL_GRAALVM_ARTIFACTS':
44064204
dist = mx.distribution(dist_name, fatalIfMissing=False)
44074205
if dist is not None:
44084206
print(f"Dependencies of the '{dist_name}' distribution:\n -", '\n - '.join(sorted(dep.name for dep in dist.deps)))
@@ -4536,11 +4334,6 @@ def graalvm_vendor_version():
45364334
mx.add_argument('--debuginfo-dists', action='store_true', help='Generate debuginfo distributions.')
45374335
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)
45384336
mx.add_argument('--disable-debuginfo-stripping', action='store_true', help='Disable the stripping of debug symbols from the native image.')
4539-
mx.add_argument('--snapshot-catalog', action='store', help='Change the default URL of the component catalog for snapshots.', default=None)
4540-
mx.add_argument('--gds-snapshot-catalog', action='store', help='Change the default appended URL of the component catalog for snapshots.', default=None)
4541-
mx.add_argument('--release-catalog', action='store', help='Change the default URL of the component catalog for releases.', default=None)
4542-
mx.add_argument('--snapshot-product-id', action='store', help='Change the default ID of the GDS product ID for snapshots.', default=None)
4543-
mx.add_argument('--release-product-id', action='store', help='Change the default ID of the GDS product ID for releases.', default=None)
45444337
mx.add_argument('--extra-image-builder-argument', action='append', help='Add extra arguments to the image builder.', default=[])
45454338
mx.add_argument('--image-profile', action='append', help='Add a profile to be used while building a native image.', default=[])
45464339
mx.add_argument('--no-licenses', action='store_true', help='Do not add license files in the archives.')
@@ -4896,26 +4689,6 @@ def _rebuildable_image(image_config):
48964689
return name not in non_rebuildable
48974690

48984691

4899-
def _snapshot_catalog():
4900-
return mx.get_opts().snapshot_catalog or mx.get_env('SNAPSHOT_CATALOG')
4901-
4902-
4903-
def _gds_snapshot_catalog():
4904-
return mx.get_opts().gds_snapshot_catalog or mx.get_env('GDS_SNAPSHOT_CATALOG')
4905-
4906-
4907-
def _snapshot_product_id():
4908-
return mx.get_opts().snapshot_product_id or mx.get_env('SNAPSHOT_PRODUCT_ID')
4909-
4910-
4911-
def _release_catalog():
4912-
return mx.get_opts().release_catalog or mx.get_env('RELEASE_CATALOG')
4913-
4914-
4915-
def _release_product_id():
4916-
return mx.get_opts().release_product_id or mx.get_env('RELEASE_PRODUCT_ID')
4917-
4918-
49194692
def _base_jdk_info():
49204693
base_jdk_info = mx.get_opts().base_jdk_info or mx.get_env('BASE_JDK_INFO')
49214694
if base_jdk_info is None:

vm/ce-release-artifacts.json

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -358,38 +358,5 @@
358358
"name_template": "{name}-community-jvm-{version}-{os}-{arch}"
359359
}
360360
]
361-
},
362-
{
363-
"name": "graalvm-espresso-community-java21",
364-
"core": true,
365-
"jdk": "jdk_21",
366-
"override_name":"espresso",
367-
"artifacts": [
368-
{
369-
"os": "linux",
370-
"arch": "amd64",
371-
"name_template": "{name}-community-{version}-{os}-{arch}"
372-
},
373-
{
374-
"os": "linux",
375-
"arch": "aarch64",
376-
"name_template": "{name}-community-{version}-{os}-{arch}"
377-
},
378-
{
379-
"os": "darwin",
380-
"arch": "amd64",
381-
"name_template": "{name}-community-{version}-macos-{arch}"
382-
},
383-
{
384-
"os": "darwin",
385-
"arch": "aarch64",
386-
"name_template": "{name}-community-{version}-macos-{arch}"
387-
},
388-
{
389-
"os": "windows",
390-
"arch": "amd64",
391-
"name_template": "{name}-community-{version}-{os}-{arch}"
392-
}
393-
]
394361
}
395362
]

0 commit comments

Comments
 (0)