# # Launchers and other components. # mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name="GraalWasm", short_name="gwa", dir_name="wasm", license_files=["LICENSE_WASM.txt"], third_party_license_files=[], dependencies=["Truffle"], truffle_jars=["wasm:WASM"], support_distributions=["wasm:WASM_GRAALVM_LICENSES"], launcher_configs=[ mx_sdk_vm.LanguageLauncherConfig( destination="bin/<exe:wasm>", jar_distributions=["wasm:WASM_LAUNCHER"], main_class="org.graalvm.wasm.launcher.WasmLauncher", build_args=[], language="wasm", ), ], installable=True, )) # # Mx commands. #
license_files=[], third_party_license_files=[], dependencies=['Truffle'], support_distributions=['truffle:TRUFFLE_GRAALVM_SUPPORT'], stability="supported", )) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Truffle NFI', short_name='nfi', dir_name='nfi', license_files=[], third_party_license_files=[], dependencies=['Truffle'], truffle_jars=['truffle:TRUFFLE_NFI', 'truffle:TRUFFLE_NFI_LIBFFI'], support_distributions=['truffle:TRUFFLE_NFI_GRAALVM_SUPPORT'], support_libraries_distributions=[ 'truffle:TRUFFLE_NFI_NATIVE_GRAALVM_SUPPORT' ], installable=False, stability="supported", )) mx.update_commands( _suite, { 'check-filename-length': [check_filename_length, ""], 'create-dsl-parser': [create_dsl_parser, "create the DSL expression parser using antlr"], 'create-sl-parser': [create_sl_parser, "create the SimpleLanguage parser using antlr"],
short_name='tflm', dir_name='truffle', license_files=[], third_party_license_files=[], dependencies=['Truffle'], support_distributions=['truffle:TRUFFLE_GRAALVM_SUPPORT'] )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Truffle NFI', short_name='nfi', dir_name='nfi', license_files=[], third_party_license_files=[], dependencies=['Truffle'], truffle_jars=['truffle:TRUFFLE_NFI'], support_distributions=['truffle:TRUFFLE_NFI_GRAALVM_SUPPORT'], support_headers_distributions=['truffle:TRUFFLE_NFI_GRAALVM_HEADERS_SUPPORT'], support_libraries_distributions=['truffle:TRUFFLE_NFI_NATIVE_GRAALVM_SUPPORT'], installable=False, )) mx.update_commands(_suite, { 'check-filename-length' : [check_filename_length, ""], 'create-dsl-parser' : [create_dsl_parser, "create the DSL expression parser using antlr"], 'create-sl-parser' : [create_sl_parser, "create the SimpleLanguage parser using antlr"], })
# import mx import mx_sdk_vm from mx_unittest import unittest from mx_gate import Task, add_gate_runner _suite = mx.suite('regex') def _tregex_tests_gate_runner(args, tasks): with Task('UnitTests', tasks, tags=['default', 'all']) as t: if t: unittest(['--enable-timing', '--very-verbose', 'com.oracle.truffle.regex']) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='TRegex', short_name='rgx', dir_name='regex', license_files=[], third_party_license_files=[], dependencies=['Truffle'], truffle_jars=['regex:TREGEX'], support_distributions=['regex:TREGEX_GRAALVM_SUPPORT'], installable=False, )) add_gate_runner(_suite, _tregex_tests_gate_runner)
name='PolyBench Instruments', short_name='pbi', dir_name='pbi', license_files=[], third_party_license_files=[], dependencies=['Truffle', 'PolyBench Launcher'], truffle_jars=['vm:POLYBENCH_INSTRUMENTS'], support_distributions=['vm:POLYBENCH_INSTRUMENTS_SUPPORT'], )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Polyglot Microbenchmark Harness', short_name='pmh', dir_name='pmh', license_files=[], third_party_license_files=[], dependencies=['Truffle', 'PolyBench Launcher'], truffle_jars=['vm:PMH'], support_distributions=['vm:PMH_SUPPORT'], installable=False, )) if mx.suite('tools', fatalIfMissing=False) is not None and mx.suite('graal-js', fatalIfMissing=False) is not None: mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmJdkComponent( suite=_suite, name='VisualVM', short_name='vvm', dir_name='visualvm', license_files=[], third_party_license_files=[], dependencies=['Graal.js'],
mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Java on Truffle', short_name='java', installable_id='espresso', installable=True, license_files=[], third_party_license_files=[], dependencies=['Truffle', 'Truffle NFI', 'ejvm'], truffle_jars=['espresso:ESPRESSO'], support_distributions=['espresso:ESPRESSO_SUPPORT'], library_configs=[ mx_sdk_vm.LibraryConfig( destination='lib/<lib:espresso>', jar_distributions=['espresso:LIB_ESPRESSO'], build_args=[ '--language:java', '--tool:all', ], home_finder=True, ) ], polyglot_lib_jar_dependencies=['espresso:LIB_ESPRESSO'], 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_espresso_cp, ))
"LD": "com.oracle.truffle.llvm.toolchain.launchers.Linker", "BINUTIL": "com.oracle.truffle.llvm.toolchain.launchers.BinUtil", }, suite=_suite) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='LLVM Runtime Core', short_name='llrc', dir_name='llvm', license_files=['sulong:SULONG_GRAALVM_DOCS/LICENSE_SULONG.txt'], third_party_license_files=[ 'sulong:SULONG_GRAALVM_DOCS/THIRD_PARTY_LICENSE_SULONG.txt' ], dependencies=['Truffle', 'Truffle NFI'], truffle_jars=[ 'sulong:SULONG_CORE', 'sulong:SULONG_API', 'sulong:SULONG_NFI' ], support_distributions=[ 'sulong:SULONG_CORE_HOME', 'sulong:SULONG_GRAALVM_DOCS', ], installable=True, priority=0, # this is the main component of the llvm installable )) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='LLVM Runtime Native', short_name='llrn',
}, suite=_suite) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Sulong', short_name='slg', dir_name='llvm', license_files=[], third_party_license_files=[], dependencies=['Truffle', 'Truffle NFI'], truffle_jars=['sulong:SULONG', 'sulong:SULONG_API'], support_distributions=[ 'sulong:SULONG_HOME', 'sulong:SULONG_GRAALVM_DOCS', ], launcher_configs=[ mx_sdk_vm.LanguageLauncherConfig( destination='bin/<exe:lli>', jar_distributions=['sulong:SULONG_LAUNCHER'], main_class='com.oracle.truffle.llvm.launcher.LLVMLauncher', build_args=[], language='llvm', ), ] + _suite.toolchain.get_launcher_configs(), installable=False, )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmJreComponent( suite=_suite, name='LLVM.org toolchain',
) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Java on Truffle', short_name='java', installable_id='espresso', installable=True, license_files=['LICENSE_JAVAONTRUFFLE'], third_party_license_files=[], dependencies=['Truffle', 'Truffle NFI', 'ejvm'], truffle_jars=['espresso:ESPRESSO'], support_distributions=['espresso:ESPRESSO_SUPPORT'], library_configs=[espresso_library_config], polyglot_lib_jar_dependencies=['espresso:LIB_ESPRESSO'], 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_espresso_cp, stability="experimental", )) if LLVM_JAVA_HOME:
"CXX": "com.oracle.truffle.llvm.toolchain.launchers.ClangXX", "LD": "com.oracle.truffle.llvm.toolchain.launchers.Linker", "BINUTIL": "com.oracle.truffle.llvm.toolchain.launchers.BinUtil", }, suite=_suite) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='LLVM Runtime Core', short_name='llrc', dir_name='llvm', license_files=[], third_party_license_files=[], dependencies=['Truffle', 'Truffle NFI'], truffle_jars=[ 'sulong:SULONG_CORE', 'sulong:SULONG_API', 'sulong:SULONG_NFI' ], support_distributions=[ 'sulong:SULONG_CORE_HOME', 'sulong:SULONG_GRAALVM_DOCS', ], installable=False, )) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='LLVM Runtime Native', short_name='llrn', dir_name='llvm',
dir_name='truffle', license_files=[], third_party_license_files=[], dependencies=['Truffle'], support_distributions=['truffle:TRUFFLE_GRAALVM_SUPPORT'], stability="supported", )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Truffle NFI', short_name='nfi', dir_name='nfi', license_files=[], third_party_license_files=[], dependencies=['Truffle'], truffle_jars=['truffle:TRUFFLE_NFI'], support_distributions=['truffle:TRUFFLE_NFI_GRAALVM_SUPPORT'], support_libraries_distributions=['truffle:TRUFFLE_NFI_NATIVE_GRAALVM_SUPPORT'], installable=False, stability="supported", )) mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Truffle NFI LIBFFI', short_name='nfi-libffi', dir_name='nfi-libffi', license_files=[], third_party_license_files=[], dependencies=['Truffle', 'Truffle NFI'],
def verify_ci(args): """Verify CI configuration""" mx.verify_ci(args, mx.suite('truffle'), _suite, 'common.json') mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='TruffleRuby license files', short_name='rbyl', dir_name='ruby', license_files=['LICENSE_TRUFFLERUBY.txt'], third_party_license_files=['3rd_party_licenses_truffleruby.txt'], dependencies=[], truffle_jars=[], support_distributions=[ 'truffleruby:TRUFFLERUBY_GRAALVM_LICENSES', ], priority=5, stability="experimental", )) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='TruffleRuby', short_name='rby', dir_name='ruby', standalone_dir_name='truffleruby-<version>-<graalvm_os>-<arch>',
# REGISTER MX GATE RUNNER ######################### add_gate_runner(_suite, _brainfck_gate_runner) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='Brainfck', short_name='bf', license_files=[], third_party_license_files=[], dependencies=['Truffle'], truffle_jars=['brainfck:BRAINFCK'], support_distributions=['brainfck:BRAINFCK_SUPPORT'], launcher_configs=[ mx_sdk_vm.LanguageLauncherConfig( destination='bin/<exe:bf>', jar_distributions=['brainfck:BRAINFCK_LAUNCHER'], main_class= 'com.oracle.truffle.brainfck.launcher.BrainfckLauncher', build_args=['--language:bf'], language='bf', ) ], )) # Register new commands which can be used from the commandline with mx mx.update_commands( _suite, { 'bf': [_run_brainfck_launcher, '[args]'], 'bf-standalone': [_run_brainfck_standalone, '[args]'],
from mx_unittest import unittest from mx_gate import Task, add_gate_runner _suite = mx.suite('regex') def _tregex_tests_gate_runner(args, tasks): with Task('UnitTests', tasks, tags=['default', 'all']) as t: if t: unittest([ '--enable-timing', '--very-verbose', 'com.oracle.truffle.regex' ]) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='TRegex', short_name='rgx', dir_name='regex', license_files=[], third_party_license_files=[], dependencies=['Truffle', 'ICU4J'], truffle_jars=['regex:TREGEX'], support_distributions=['regex:TREGEX_GRAALVM_SUPPORT'], installable=False, stability="supported", )) add_gate_runner(_suite, _tregex_tests_gate_runner)
import mx import mx_sdk_vm from mx_unittest import unittest from mx_gate import Task, add_gate_runner _suite = mx.suite('regex') def _tregex_tests_gate_runner(args, tasks): with Task('UnitTests', tasks, tags=['default', 'all']) as t: if t: unittest([ '--enable-timing', '--very-verbose', 'com.oracle.truffle.regex' ]) mx_sdk_vm.register_graalvm_component( mx_sdk_vm.GraalVmLanguage( suite=_suite, name='TRegex', short_name='rgx', dir_name='regex', license_files=[], third_party_license_files=[], dependencies=['Truffle'], truffle_jars=['regex:TREGEX'], support_distributions=['regex:TREGEX_GRAALVM_SUPPORT'], )) add_gate_runner(_suite, _tregex_tests_gate_runner)