Skip to content

Commit c72fe07

Browse files
committed
[GR-65374] Unchained standalone cleanups
* Use the correct predicates from mx_sdk_vm_ng. * Set language_id for deployment. * Standardize how truffle-runtime.jar is excluded. * Remove unused old-standalone configuration.
1 parent f36d95b commit c72fe07

File tree

3 files changed

+10
-44
lines changed

3 files changed

+10
-44
lines changed

mx.truffleruby/jvm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
DYNAMIC_IMPORTS=/tools
22
BUILD_TARGETS=TRUFFLERUBY_JVM_STANDALONE
3+
EXCLUDE_TRUFFLE_RUNTIME=true

mx.truffleruby/mx_truffleruby.py

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import mx_gate
2121
import mx_sdk
2222
import mx_sdk_vm
23+
import mx_sdk_vm_ng
2324
import mx_subst
2425
import mx_spotbugs
2526
import mx_truffle
@@ -189,21 +190,15 @@ def __init__(self, suite, name, deps, workingSets, output=None, **kwArgs):
189190

190191
# Functions called from suite.py
191192

192-
def has_suite(name):
193-
return mx.suite(name, fatalIfMissing=False)
194-
195-
def is_ee():
196-
return has_suite('truffle-enterprise')
197-
198193
def truffleruby_standalone_deps():
199-
deps = mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=has_suite('compiler'))
200-
if is_ee():
194+
include_truffle_runtime = not mx.env_var_to_bool("EXCLUDE_TRUFFLE_RUNTIME")
195+
deps = mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=include_truffle_runtime)
196+
if mx_sdk_vm_ng.uses_enterprise_sources():
201197
deps += ['sulong-managed:SULONG_ENTERPRISE_NATIVE']
202198
return deps
203199

204200
def librubyvm_build_args():
205-
if is_ee() and mx.get_os() == 'linux' and 'NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE' not in os.environ:
206-
mx.suite('substratevm-enterprise-gcs', fatalIfMissing=True) # fail early if missing
201+
if mx_sdk_vm_ng.is_nativeimage_ee() and mx.get_os() == 'linux' and 'NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE' not in os.environ:
207202
return ['--gc=G1', '-H:-ProtectionKeys']
208203
else:
209204
return []
@@ -322,39 +317,16 @@ def ruby_maven_deploy_public_repo_dir(args):
322317
'truffleruby:TRUFFLERUBY_GRAALVM_LICENSES',
323318
],
324319
priority=5,
325-
stability="experimental",
326-
))
327-
328-
# Only keep what we need from the Sulong home.
329-
# Exclude the toolchain launchers, we don't need them, and they would not work in the native standalone.
330-
# Excluding "native/bin" or "native/bin/*" does not work so we have to list them.
331-
toolchain_launchers = ['binutil', 'clang', 'clang++', 'clang-cl', 'flang', 'ld']
332-
sulong_home_excludes = [f"native/bin/graalvm-native-{launcher}" for launcher in toolchain_launchers] + \
333-
['native/cmake', 'native/include', 'native/lib/*++*', 'native/share']
334-
standalone_dependencies_common = {
335-
'LLVM Runtime Core': ('lib/sulong', []),
336-
'LLVM Runtime Native': ('lib/sulong', sulong_home_excludes),
337-
}
320+
stability="experimental"))
338321

339322
mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage(
340323
suite=_suite,
341324
name='TruffleRuby',
342325
short_name='rby',
343326
dir_name='ruby',
344-
standalone_dir_name='truffleruby-community-<version>-<graalvm_os>-<arch>',
345-
standalone_dir_name_enterprise='truffleruby-<version>-<graalvm_os>-<arch>',
346327
license_files=[],
347328
third_party_license_files=[],
348329
dependencies=['rbyl', 'Truffle', 'Truffle NFI', 'LLVM Runtime Native', 'TRegex'], # Use short name for license to select by priority
349-
standalone_dependencies={**standalone_dependencies_common, **{
350-
'TruffleRuby license files': ('', []),
351-
}},
352-
standalone_dependencies_enterprise={**standalone_dependencies_common, **{
353-
'LLVM Runtime Enterprise': ('lib/sulong', []), # sulong-managed:SULONG_ENTERPRISE
354-
'LLVM Runtime Native Enterprise': ('lib/sulong', []), # sulong-managed:SULONG_ENTERPRISE_NATIVE
355-
'TruffleRuby license files EE': ('', []),
356-
'GraalVM enterprise license files': ('', ['LICENSE.txt', 'GRAALVM-README.md']),
357-
}},
358330
truffle_jars=[
359331
# Distributions
360332
'truffleruby:TRUFFLERUBY',
@@ -402,16 +374,7 @@ def ruby_maven_deploy_public_repo_dir(args):
402374
]
403375
)
404376
],
405-
stability="experimental",
406-
post_install_msg="""
407-
IMPORTANT NOTE:
408-
---------------
409-
The Ruby openssl C extension needs to be recompiled on your system to work with the installed libssl.
410-
First, make sure TruffleRuby's dependencies are installed, which are described at:
411-
https://github.com/oracle/truffleruby/blob/master/README.md#dependencies
412-
Then run the following command:
413-
${graalvm_languages_dir}/ruby/lib/truffle/post_install_hook.sh""",
414-
))
377+
stability="experimental"))
415378

416379
mx.update_commands(_suite, {
417380
'ruby': [ruby_run_ruby, ''],

mx.truffleruby/suite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@
994994
"standalone_dist": "TRUFFLERUBY_NATIVE_STANDALONE",
995995
"community_archive_name": "truffleruby-community",
996996
"enterprise_archive_name": "truffleruby",
997+
"language_id": "ruby",
997998
},
998999

9991000
"TRUFFLERUBY_JVM_STANDALONE_RELEASE_ARCHIVE": {
@@ -1002,6 +1003,7 @@
10021003
"standalone_dist": "TRUFFLERUBY_JVM_STANDALONE",
10031004
"community_archive_name": "truffleruby-community-jvm",
10041005
"enterprise_archive_name": "truffleruby-jvm",
1006+
"language_id": "ruby",
10051007
},
10061008

10071009
"TRUFFLERUBY_GRAALVM_LICENSES": {

0 commit comments

Comments
 (0)