Skip to content

Commit 8ede3c7

Browse files
committed
[GR-71369] Links to links should target the final link name.
PullRequest: graal/22618
2 parents e6c0876 + f0dc001 commit 8ede3c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,10 @@ def _add_native_image_macro(image_config, component, stage1):
420420
for profile in _image_profiles(GraalVmNativeProperties.canonical_image_name(image_config)):
421421
_add(layout, _macro_dir, 'file:{}'.format(abspath(profile)))
422422

423-
def _add_link(_dest, _target, _component=None, _dest_base_name=None):
423+
def _add_link(_dest, _target, _component=None, _suggested_dest_base_name=None):
424424
assert _dest.endswith('/')
425425
_linkname = relpath(path_substitutions.substitute(_target), start=path_substitutions.substitute(_dest[:-1]))
426-
dest_base_name = _dest_base_name or basename(_target)
426+
dest_base_name = _suggested_dest_base_name or basename(_target)
427427
if _linkname != dest_base_name:
428428
if mx.is_windows():
429429
if _target.endswith('.exe') or _target.endswith('.cmd'):
@@ -585,10 +585,10 @@ def _add_link(_dest, _target, _component=None, _dest_base_name=None):
585585
_link_dest = _component_base + _component_link
586586
# add links `LauncherConfig.links` -> `LauncherConfig.destination`
587587
_link_dest_dir, _link_dest_base_name = os.path.split(_link_dest)
588-
_add_link(_link_dest_dir + '/', _launcher_dest, _component, _dest_base_name=_link_dest_base_name)
588+
_final_link_dest = _add_link(_link_dest_dir + '/', _launcher_dest, _component, _suggested_dest_base_name=_link_dest_base_name)
589589
# add links from jre/bin to component link
590590
if _launcher_config.default_symlinks:
591-
_link_path = _add_link(_jdk_jre_bin, _link_dest, _component)
591+
_link_path = _add_link(_jdk_jre_bin, _final_link_dest, _component)
592592
_jre_bin_names.append(basename(_link_path))
593593
if stage1 or _rebuildable_image(_launcher_config):
594594
_add_native_image_macro(_launcher_config, _component, stage1)

0 commit comments

Comments
 (0)