Skip to content

[GR-65374] Unchained standalone cleanups #11302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@
third_party_license_files=[],
truffle_jars=[],
dir_name='java',
installable_id='espresso-compiler-stub',
installable=True,
dependencies=['Java on Truffle'],
support_distributions=['espresso-compiler-stub:ESPRESSO_COMPILER_SUPPORT'],
priority=2,
stability=_espresso_stability,
standalone=False,
))

def create_ni_standalone(base_standalone_name, register_distribution):
Expand Down
33 changes: 2 additions & 31 deletions espresso/mx.espresso/mx_espresso.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def javavm_deps():

def javavm_build_args():
result = []
# GR-64948: On GraalVM 21 CopyLanguageResources is incorrectly detected as experimental
if mx_sdk_vm_ng.get_bootstrap_graalvm_version() >= mx.VersionSpec("24.0"):
result += ['--enable-monitoring=threaddump', '-H:+CopyLanguageResources']
else:
Expand Down Expand Up @@ -403,13 +404,6 @@ def contents(self):
#########################
add_gate_runner(_suite, _espresso_gate_runner)


if mx.is_windows():
lib_javavm_cp = '%GRAALVM_HOME%\\lib\\graalvm\\lib-javavm.jar'
else:
lib_javavm_cp = '${GRAALVM_HOME}/lib/graalvm/lib-javavm.jar'


espresso_library_config = mx_sdk_vm.LanguageLibraryConfig(
language='java',
jar_distributions=['espresso:LIB_JAVAVM'],
Expand All @@ -434,8 +428,6 @@ def contents(self):
suite=_suite,
name='Java on Truffle',
short_name='java',
installable_id='espresso',
installable=True,
license_files=['LICENSE_JAVAONTRUFFLE'],
third_party_license_files=[],
dependencies=['Truffle', 'nfi-libffi', 'ejvm'],
Expand All @@ -445,18 +437,7 @@ def contents(self):
polyglot_lib_jar_dependencies=['espresso:LIB_JAVAVM'],
has_polyglot_lib_entrypoints=True,
priority=1,
post_install_msg="""
This version of Java on Truffle is experimental. We do not recommended it for production use.

Usage: java -truffle [-options] class [args...]
(to execute a class)
or java -truffle [-options] -jar jarfile [args...]
(to execute a jar file)

To rebuild the polyglot library:
gu rebuild-images libpolyglot -cp """ + lib_javavm_cp,
stability=_espresso_stability,
standalone=False,
))

if espresso_llvm_java_home:
Expand All @@ -468,14 +449,10 @@ def contents(self):
third_party_license_files=[],
truffle_jars=[],
dir_name='java',
installable_id='espresso-llvm',
extra_installable_qualifiers=mx_sdk_vm.extra_installable_qualifiers(jdk_home=espresso_llvm_java_home, ce_edition=['ce'], oracle_edition=['ee']),
installable=True,
dependencies=['Java on Truffle', 'LLVM Runtime Native'],
support_distributions=['espresso:ESPRESSO_LLVM_SUPPORT'],
priority=2,
stability=_espresso_stability,
standalone=False,
))


Expand Down Expand Up @@ -600,8 +577,7 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi
community_archive_name="espresso-community",
enterprise_archive_name="espresso",
community_dist_name=f'GRAALVM_ESPRESSO_COMMUNITY_JAVA{java_home_dep.major_version}',
enterprise_dist_name=f'GRAALVM_ESPRESSO_JAVA{java_home_dep.major_version}',
standalone_prefix=False))
enterprise_dist_name=f'GRAALVM_ESPRESSO_JAVA{java_home_dep.major_version}'))


def espresso_resources_suite():
Expand Down Expand Up @@ -822,8 +798,6 @@ def build(self):
name='Espresso libjvm',
short_name='ejvm',
dir_name='truffle',
installable_id='espresso',
installable=True,
license_files=[],
third_party_license_files=[],
dependencies=['Java on Truffle'],
Expand All @@ -841,7 +815,6 @@ def build(self):
suite=_suite,
name='Espresso Launcher',
short_name='elau',
installable=False,
license_files=[],
third_party_license_files=[],
dependencies=['Java on Truffle'],
Expand All @@ -862,8 +835,6 @@ def build(self):
name='Espresso Standalone jvm.cfg',
short_name='ejc',
dir_name='.',
installable_id='espresso',
installable=True,
license_files=[],
third_party_license_files=[],
dependencies=['Java on Truffle'],
Expand Down
2 changes: 0 additions & 2 deletions regex/mx.regex/mx_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def _tregex_tests_gate_runner(args, tasks):
dependencies=['Truffle', 'ICU4J'],
truffle_jars=['regex:TREGEX'],
support_distributions=['regex:TREGEX_GRAALVM_SUPPORT'],
installable=True,
standalone=False,
stability="supported",
))

Expand Down
2 changes: 0 additions & 2 deletions sdk/mx.sdk/mx_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ def upx(args):
suite=_suite,
name='LLVM.org toolchain',
short_name='llp',
installable=True,
installable_id='llvm-toolchain',
dir_name='llvm',
license_files=[],
third_party_license_files=['3rd_party_license_llvm-toolchain.txt'],
Expand Down
14 changes: 1 addition & 13 deletions sdk/mx.sdk/mx_sdk_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def __init__(self,
self.standalone = None
self.post_install_msg = None
self.installable_id = None
self.extra_installable_qualifiers = extra_installable_qualifiers or []
self.extra_installable_qualifiers = None
self.has_relative_home = has_relative_home
self.jvm_configs = jvm_configs or []
self.extra_native_targets = extra_native_targets
Expand Down Expand Up @@ -379,7 +379,6 @@ def __init__(self,
assert isinstance(self.jvmci_parent_jars, list)
assert isinstance(self.launcher_configs, list)
assert isinstance(self.library_configs, list)
assert isinstance(self.extra_installable_qualifiers, list)

assert not any(cp_arg in self.polyglot_lib_build_args for cp_arg in ('-cp', '-classpath')), "the '{}' component passes a classpath argument to libpolylgot: '{}'. Use `polyglot_lib_jar_dependencies` instead".format(self.name, ' '.join(self.polyglot_lib_build_args))

Expand Down Expand Up @@ -1221,17 +1220,6 @@ def ee_implementor(jdk_home=base_jdk().home):
return False


def extra_installable_qualifiers(jdk_home, ce_edition, oracle_edition):
"""
Returns the edition name depending on the value of the `IMPLEMENTOR` field of the `release` file of a given JDK.
:type jdk_home: str
:type ce_edition: list[str] | None
:type oracle_edition: list[str] | None
:rtype: list[str] | None
"""
return oracle_edition if ee_implementor(jdk_home) else ce_edition


@mx.command(_suite, 'verify-graalvm-configs')
def _verify_graalvm_configs(args):
parser = ArgumentParser(prog='mx verify-graalvm-configs', description='Verify registered GraalVM configs')
Expand Down
15 changes: 0 additions & 15 deletions substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing
suite=suite,
name='SubstrateVM',
short_name='svm',
installable_id='native-image',
license_files=[],
third_party_license_files=[],
# Use short name for Truffle Runtime SVM to select by priority
Expand All @@ -1255,7 +1254,6 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing
extra_native_targets=['linux-default-glibc', 'linux-default-musl'] if mx.is_linux() and not mx.get_arch() == 'riscv64' else None,
stability="earlyadopter",
jlink=False,
installable=False,
)
mx_sdk_vm.register_graalvm_component(svm)

Expand All @@ -1264,14 +1262,12 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing
name='SVM Truffle NFI Support',
short_name='svmnfi',
dir_name='nfi',
installable_id='native-image',
license_files=[],
third_party_license_files=[],
dependencies=['SubstrateVM', 'Truffle NFI'],
truffle_jars=[],
builder_jar_distributions=[],
support_distributions=['substratevm:SVM_NFI_GRAALVM_SUPPORT'],
installable=False,
)
mx_sdk_vm.register_graalvm_component(svm_nfi)

Expand All @@ -1280,11 +1276,9 @@ def native_image_context_run(func, func_args=None, config=None, build_if_missing
name='SubstrateVM Static Libraries',
short_name='svmsl',
dir_name=False,
installable_id='native-image',
license_files=[],
third_party_license_files=[],
support_distributions=['substratevm:SVM_STATIC_LIBRARIES_SUPPORT'],
installable=False,
)
mx_sdk_vm.register_graalvm_component(svm_static_libs)

Expand Down Expand Up @@ -1330,7 +1324,6 @@ def _native_image_launcher_extra_jvm_args():
name='Native Image',
short_name='ni',
dir_name='svm',
installable_id='native-image',
license_files=[],
third_party_license_files=[],
dependencies=['SubstrateVM', 'nil'] + additional_ni_dependencies,
Expand Down Expand Up @@ -1382,7 +1375,6 @@ def _native_image_launcher_extra_jvm_args():
home_finder=False,
),
],
installable=True,
stability="earlyadopter",
jlink=False,
)
Expand All @@ -1393,12 +1385,10 @@ def _native_image_launcher_extra_jvm_args():
name='Native Image licence files',
short_name='nil',
dir_name='svm',
installable_id='native-image',
license_files=['LICENSE_NATIVEIMAGE.txt'],
third_party_license_files=[],
dependencies=[],
support_distributions=['substratevm:NATIVE_IMAGE_LICENSE_GRAALVM_SUPPORT'],
installable=False,
priority=1,
stability="earlyadopter",
jlink=False,
Expand All @@ -1409,7 +1399,6 @@ def _native_image_launcher_extra_jvm_args():
name='Native Image LLVM Backend',
short_name='svml',
dir_name='svm',
installable_id='native-image-llvm-backend',
license_files=[],
third_party_license_files=[],
dependencies=[
Expand All @@ -1424,8 +1413,6 @@ def _native_image_launcher_extra_jvm_args():
'substratevm:JAVACPP_PLATFORM_SPECIFIC_SHADOWED',
],
stability="experimental-earlyadopter",
installable=True,
extra_installable_qualifiers=['ce'],
jlink=False,
)
# GR-34811
Expand Down Expand Up @@ -1696,8 +1683,6 @@ def _native_image_configure_extra_jvm_args():
)
],
jlink=False,
installable_id='native-image',
installable=False,
priority=10,
))

Expand Down
50 changes: 11 additions & 39 deletions sulong/mx.sulong/mx_sulong.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import mx_sdk_vm_impl
import mx_subst
import mx_sdk_vm
import mx_sdk_vm_ng
import mx_benchmark
import mx_sulong_benchmarks
import mx_sulong_fuzz #pylint: disable=unused-import
Expand Down Expand Up @@ -109,12 +110,10 @@ def sulong_prefix_path(name):
def has_suite(name):
return mx.suite(name, fatalIfMissing=False)

def is_ee():
return has_suite('sulong-managed')

def sulong_standalone_deps():
deps = mx_truffle.resolve_truffle_dist_names()
if is_ee():
include_truffle_runtime = not mx.env_var_to_bool("EXCLUDE_TRUFFLE_RUNTIME")
deps = mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=include_truffle_runtime)
if has_suite('sulong-managed'):
# SULONG_ENTERPRISE and SULONG_MANAGED do not belong in the EE standalone of SULONG_NATIVE, but we want a single definition of libllvmvm.
# So we compromise here by including them. We do not use or distribute the EE standalone of SULONG_NATIVE so it does not matter.
# See also the comments in suite.py, in SULONG_*_STANDALONE_RELEASE_ARCHIVE.
Expand All @@ -126,11 +125,15 @@ def sulong_standalone_deps():
return deps

def libllvmvm_build_args():
if is_ee() and not mx.is_windows():
return [
if mx_sdk_vm_ng.is_nativeimage_ee() and not mx.is_windows():
image_build_args = [
'-H:+AuxiliaryEngineCache',
'-H:ReservedAuxiliaryImageBytes=2145482548',
]
# GR-64948: On GraalVM 21 some Native Image stable options are incorrectly detected as experimental
if mx_sdk_vm_ng.get_bootstrap_graalvm_jdk_version() < mx.VersionSpec("25"):
image_build_args = ['-H:+UnlockExperimentalVMOptions', *image_build_args, '-H:-UnlockExperimentalVMOptions']
return image_build_args
else:
return []

Expand Down Expand Up @@ -313,7 +316,7 @@ def get_lli_path(fatalIfMissing=True):
useJvm = False
else:
mx.abort(f"Unknown standalone type {standaloneMode}.")
if is_ee():
if has_suite('sulong-managed'):
dist = "SULONG_MANAGED_JVM_STANDALONE" if useJvm else "SULONG_MANAGED_NATIVE_STANDALONE"
else:
dist = "SULONG_JVM_STANDALONE" if useJvm else "SULONG_NATIVE_STANDALONE"
Expand Down Expand Up @@ -586,8 +589,6 @@ def _get_jar_dists(self):
support_distributions=[
'sulong:SULONG_GRAALVM_LICENSES',
],
installable=True,
standalone=False,
has_relative_home=False,
stability='experimental' if mx.get_os() == 'windows' else 'supported',
priority=1, # this component is part of the llvm installable but it's not the main one
Expand All @@ -607,8 +608,6 @@ def _get_jar_dists(self):
'sulong:SULONG_CORE_HOME',
'sulong:SULONG_GRAALVM_DOCS',
],
installable=True,
standalone=False,
stability='experimental' if mx.get_os() == 'windows' else 'supported',
priority=1, # this component is part of the llvm installable but it's not the main one
))
Expand All @@ -628,41 +627,18 @@ def _get_jar_dists(self):
'sulong:SULONG_NATIVE_HOME',
],
launcher_configs=_suite.toolchain.get_launcher_configs(),
installable=True,
standalone=False,
priority=1, # this component is part of the llvm installable but it's not the main one
))


standalone_dependencies_common = {
'LLVM Runtime Core': ('lib/sulong', []),
'LLVM Runtime Native': ('lib/sulong', []),
'LLVM.org toolchain': ('lib/llvm-toolchain', []),
}


mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage(
suite=_suite,
name='LLVM Runtime Launcher',
short_name='llrl',
dir_name='llvm',
standalone_dir_name='llvm-community-<version>-<graalvm_os>-<arch>',
standalone_dir_name_enterprise='llvm-<version>-<graalvm_os>-<arch>',
license_files=[],
third_party_license_files=[],
dependencies=['ANTLR4', 'Truffle', 'Truffle NFI', 'Truffle NFI LIBFFI', 'LLVM Runtime Core'],
standalone_dependencies={**standalone_dependencies_common, **{
'LLVM Runtime License Files': ('', []),
}},
standalone_dependencies_enterprise={**standalone_dependencies_common, **{
'LLVM Runtime Enterprise': ('lib/sulong', []),
'LLVM Runtime Native Enterprise': ('lib/sulong', []),
**({} if mx.is_windows() else {
'LLVM Runtime Managed': ('lib/sulong', []),
}),
'LLVM Runtime License Files EE': ('', []),
'GraalVM enterprise license files': ('', ['LICENSE.txt', 'GRAALVM-README.md']),
}},
truffle_jars=[],
support_distributions=[],
library_configs=[
Expand All @@ -677,12 +653,8 @@ def _get_jar_dists(self):
] if not mx.is_windows() else [],
language='llvm',
# When building a GraalVM, we do not need to set a default relative home path.
# When building a Standalone, it would be wrong to set it since the default
# value (`..`) is overridden by the standalone dependency (`./sulong`).
set_default_relative_home_path=False,
)
],
installable=True,
standalone=True,
priority=0, # this is the main component of the llvm installable and standalone
))
Loading
Loading