示例#1
0
文件: mx_wasm.py 项目: saudet/graal
#
# 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.
#
示例#2
0
#

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)
示例#3
0
_suite = mx.suite('vm')
""":type: mx.SourceSuite | mx.Suite"""

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmJdkComponent(
        suite=_suite,
        name='Component installer',
        short_name='gu',
        dir_name='installer',
        license_files=[],
        third_party_license_files=[],
        dependencies=['sdk'],
        jar_distributions=['vm:INSTALLER'],
        support_distributions=['vm:INSTALLER_GRAALVM_SUPPORT'],
        launcher_configs=[
            mx_sdk_vm.LauncherConfig(
                destination="bin/<exe:gu>",
                jar_distributions=['vm:INSTALLER'],
                dir_jars=True,
                main_class="org.graalvm.component.installer.ComponentInstaller",
                build_args=[],
                # Please see META-INF/native-image in the project for custom build options for native-image
                is_sdk_launcher=True,
                custom_launcher_script="mx.vm/gu.cmd"
                if mx.is_windows() else None,
            ),
        ],
    ))

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmComponent(
示例#4
0
mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmJdkComponent(
    suite=_suite,
    name='Component installer',
    short_name='gu',
    dir_name='installer',
    license_files=[],
    third_party_license_files=[],
    dependencies=['sdk'],
    jar_distributions=[
        'vm:INSTALLER',
        'truffle:TruffleJSON'
    ],
    support_distributions=['vm:INSTALLER_GRAALVM_SUPPORT'],
    launcher_configs=[
        mx_sdk_vm.LauncherConfig(
            destination="bin/<exe:gu>",
            jar_distributions=[
                'vm:INSTALLER',
                'truffle:TruffleJSON'
            ],
            dir_jars=True,
            main_class="org.graalvm.component.installer.ComponentInstaller",
            link_at_build_time=False,
            build_args=gu_build_args,
            # Please see META-INF/native-image in the project for custom build options for native-image
            is_sdk_launcher=True,
            custom_launcher_script="mx.vm/gu.cmd" if mx.is_windows() else None,
        ),
    ],
    stability="supported",
))
示例#5
0
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=[],
        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,
    ))
示例#6
0
    mx_spotbugs.spotbugs(args, spotbugsArgs)


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>',
示例#7
0
                                   },
                                   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',
示例#8
0
    with Task('Tools UnitTests', tasks) as t:
        if t:
            unittest([
                '--suite', 'tools', '--enable-timing', '--verbose',
                '--fail-fast'
            ])


mx_gate.add_gate_runner(_suite, _tools_gate_runner)

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmTool(
        suite=_suite,
        name='GraalVM Language Server',
        short_name='lsp',
        dir_name='lsp',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['tools:LSP_API', 'tools:LSP'],
        support_distributions=['tools:LSP_GRAALVM_SUPPORT'],
        include_by_default=True,
    ))

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmTool(
        suite=_suite,
        name='GraalVM Debug Protocol Server',
        short_name='dap',
        dir_name='dap',
        license_files=[],
        third_party_license_files=[],
        dependencies=['Truffle'],
示例#9
0
        "CC": "com.oracle.truffle.llvm.toolchain.launchers.Clang",
        "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',
示例#10
0
    ]


def javadoc(args):
    """build the Javadoc for all API packages"""
    extraArgs = build_oracle_compliant_javadoc_args(_suite, 'GraalVM', 'SDK')
    mx.javadoc(
        ['--unified', '--exclude-packages', 'org.graalvm.polyglot.tck'] +
        extraArgs + args)


mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmJreComponent(suite=_suite,
                                  name='Graal SDK',
                                  short_name='sdk',
                                  dir_name='graalvm',
                                  license_files=[],
                                  third_party_license_files=[],
                                  dependencies=[],
                                  jar_distributions=['sdk:LAUNCHER_COMMON'],
                                  boot_jars=['sdk:GRAAL_SDK']))


def mx_register_dynamic_suite_constituents(register_project,
                                           register_distribution):
    mx_sdk_vm_impl.mx_register_dynamic_suite_constituents(
        register_project, register_distribution)


def mx_post_parse_cmd_line(args):
    mx_sdk_vm_impl.mx_post_parse_cmd_line(args)
示例#11
0
def register_graalvm_component(component):
    return mx_sdk_vm.register_graalvm_component(component)
示例#12
0
)

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', 'nfi-libffi', '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="supported",
    ))

if LLVM_JAVA_HOME:
示例#13
0
def javadoc(args):
    """build the Javadoc for all API packages"""
    extraArgs = build_oracle_compliant_javadoc_args(_suite, 'GraalVM', 'SDK')
    mx.javadoc(
        ['--unified', '--exclude-packages', 'org.graalvm.polyglot.tck'] +
        extraArgs + args)


mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmJreComponent(
        suite=_suite,
        name='Graal SDK',
        short_name='sdk',
        dir_name='graalvm',
        license_files=[],
        third_party_license_files=[],
        dependencies=[],
        jar_distributions=['sdk:LAUNCHER_COMMON'],
        boot_jars=['sdk:GRAAL_SDK'],
        stability="supported",
    ))

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmJreComponent(
        suite=_suite,
        name='LLVM.org toolchain',
        short_name='llp',
        installable=True,
        installable_id='llvm-toolchain',
        dir_name='llvm',
示例#14
0
mx_unittest.add_config_participant(_unittest_config_participant)

def _tools_gate_runner(args, tasks):
    with Task('Jackpot check', tasks) as t:
        if t: jackpot(['--fail-on-warnings'], suite=None, nonZeroIsFatal=True)
    with Task('Tools UnitTests', tasks) as t:
        if t: unittest(['--suite', 'tools', '--enable-timing', '--verbose', '--fail-fast'])

mx_gate.add_gate_runner(_suite, _tools_gate_runner)

mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmTool(
    suite=_suite,
    name='GraalVM Chrome Inspector',
    short_name='ins',
    dir_name='chromeinspector',
    license_files=[],
    third_party_license_files=[],
    dependencies=['Truffle'],
    truffle_jars=['tools:CHROMEINSPECTOR'],
    support_distributions=['tools:CHROMEINSPECTOR_GRAALVM_SUPPORT'],
    include_by_default=True,
))

mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVmTool(
    suite=_suite,
    name='AgentScript',
    short_name='ats',
    dir_name='agentscript',
    license_files=[],
    third_party_license_files=[],
    dependencies=['Truffle'],
    truffle_jars=['tools:AGENTSCRIPT'],
示例#15
0
_suite = mx.suite('vm')
""":type: mx.SourceSuite | mx.Suite"""

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmJdkComponent(
        suite=_suite,
        name='Component installer',
        short_name='gu',
        dir_name='installer',
        license_files=[],
        third_party_license_files=[],
        dependencies=['sdk'],
        jar_distributions=['vm:INSTALLER', 'truffle:TruffleJSON'],
        support_distributions=['vm:INSTALLER_GRAALVM_SUPPORT'],
        launcher_configs=[
            mx_sdk_vm.LauncherConfig(
                destination="bin/<exe:gu>",
                jar_distributions=['vm:INSTALLER', 'truffle:TruffleJSON'],
                dir_jars=True,
                main_class="org.graalvm.component.installer.ComponentInstaller",
                build_args=[],
                # Please see META-INF/native-image in the project for custom build options for native-image
                is_sdk_launcher=True,
                custom_launcher_script="mx.vm/gu.cmd"
                if mx.is_windows() else None,
            ),
        ],
    ))

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmComponent(
示例#16
0
        "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',
示例#17
0
文件: mx_truffle.py 项目: cliid/graal
        self.delegate.build()

    def clean(self, forBuild=False):
        mx.rmtree(self.subject.out_dir, ignore_errors=True)


mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVmJreComponent(
        suite=_suite,
        name='Truffle',
        short_name='tfl',
        dir_name='truffle',
        license_files=[],
        third_party_license_files=[],
        dependencies=['Graal SDK'],
        jar_distributions=[
            'truffle:TRUFFLE_DSL_PROCESSOR',
            'truffle:TRUFFLE_TCK',
        ],
        jvmci_parent_jars=[
            'truffle:TRUFFLE_API',
            'truffle:LOCATOR',
        ],
        stability="supported",
    ))

mx_sdk_vm.register_graalvm_component(
    mx_sdk_vm.GraalVMSvmMacro(
        suite=_suite,
        name='Truffle Macro',
        short_name='tflm',
示例#18
0
文件: mx_brainfck.py 项目: mukel/bf
# 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]'],