mx_graal_nodejs_benchmark.register_nodejs_vms()


mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='Graal.nodejs',
        short_name='njs',
        dir_name='js',
        license_files=[],
        third_party_license_files=[],
        dependencies=['Graal.js'],
        truffle_jars=['graal-nodejs:TRUFFLENODE'],
        support_distributions=['graal-nodejs:TRUFFLENODE_GRAALVM_SUPPORT'],
        provided_executables=[
            'bin/<exe:node>',
            'bin/<cmd:npm>',
            'bin/<cmd:npx>',
        ],
        polyglot_lib_build_args=[
            "-H:+ReportExceptionStackTraces",
            "-H:JNIConfigurationResources=svmnodejs.jniconfig,svmnodejs_jdkspecific.jniconfig",
            "-H:ReflectionConfigurationResources=svmnodejs.reflectconfig",
        ],
        polyglot_lib_jar_dependencies=["graal-nodejs:TRUFFLENODE"],
        has_polyglot_lib_entrypoints=True,
        installable=False,
    ))

# pylint: disable=line-too-long
# GraalVM configs to build without the Graal compiler
Exemple #2
0
        ]
    mx.run_maven(maven_args, cwd=proj_dir)


mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmJreComponent(
        suite=suite,
        name='SubstrateVM',
        short_name='svm',
        license_files=[],
        third_party_license_files=[],
        jar_distributions=['substratevm:LIBRARY_SUPPORT'],
        builder_jar_distributions=[
            'substratevm:SVM',
            'substratevm:OBJECTFILE',
            'substratevm:POINTSTO',
        ],
        support_distributions=['substratevm:SVM_GRAALVM_SUPPORT'],
        launcher_configs=[
            mx_sdk.LauncherConfig(
                destination="bin/native-image",
                jar_distributions=["substratevm:SVM_DRIVER"],
                main_class="com.oracle.svm.driver.NativeImage",
                build_args=[
                    "-H:-ParseRuntimeOptions",
                ])
        ],
    ))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmJreComponent(
        suite=suite,
Exemple #3
0
def mx_post_parse_cmd_line(args):
    mx_graal_nodejs_benchmark.register_nodejs_vms()


mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='Graal.nodejs',
        short_name='njs',
        dir_name='js',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['graal-nodejs:TRUFFLENODE'],
        support_distributions=['graal-nodejs:TRUFFLENODE_GRAALVM_SUPPORT'],
        provided_executables=[
            join('bin', 'node'),
            join('bin', 'npm'),
        ],
        polyglot_lib_build_args=[
            "-H:JNIConfigurationResources=svmnodejs.jniconfig",
            "-H:ReflectionConfigurationResources=svmnodejs.reflectconfig",
        ],
        polyglot_lib_jar_dependencies=["graal-nodejs:TRUFFLENODE"],
        has_polyglot_lib_entrypoints=True,
    ))

mx.update_commands(
    _suite, {
        'node': [node, ''],
        'npm': [npm, ''],
    mx.suite('sulong')

    jt('test', 'specs', ':capi')
    jt('test', 'specs', ':truffle_capi')
    jt('test', 'specs', ':library_cext')
    jt('test', 'mri', '--all-sulong')
    jt('test', 'cexts')
    jt('test', 'bundle')

mx_sdk.register_graalvm_component(mx_sdk.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'],
    truffle_jars=[],
    support_distributions=[
        'truffleruby:TRUFFLERUBY_GRAALVM_LICENSES',
    ],
    priority=5,
))

mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
    suite=_suite,
    name='TruffleRuby',
    short_name='rby',
    dir_name='ruby',
    standalone_dir_name='truffleruby-<version>-<graalvm_os>-<arch>',
    license_files=[],
    third_party_license_files=[],
Exemple #5
0

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='Graal.js',
        short_name='js',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=[
            'graal-js:GRAALJS',
            'graal-js:ICU4J',
            'graal-js:ASM-6.2',
            'graal-js:ASM_TREE-6.2',
            'graal-js:ASM_ANALYSIS-6.2',
            'graal-js:ASM_COMMONS-6.2',
            'graal-js:ASM_UTIL-6.2',
        ],
        support_distributions=[
            'graal-js:GRAALJS_GRAALVM_SUPPORT', 'graal-js:ICU4J-DIST'
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                destination='bin/<exe:js>',
                jar_distributions=['graal-js:GRAALJS_LAUNCHER'],
                main_class='com.oracle.truffle.js.shell.JSLauncher',
                build_args=['--language:js'])
        ],
        boot_jars=['graal-js:GRAALJS_SCRIPTENGINE']))

mx.update_commands(
Exemple #6
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        name='Graal.Python',
        short_name='pyn',
        dir_name='python',
        documentation_files=['link:<support>/README_GRAALPYTHON.md'],
        license_files=[
            'link:<support>/GraalCE_Python_license_3rd_party_license.txt'
        ],
        third_party_license_files=[],
        truffle_jars=[
            'dependency:graalpython:GRAALPYTHON',
            'dependency:graalpython:GRAALPYTHON-ENV',
        ],
        support_distributions=[
            'extracted-dependency:graalpython:GRAALPYTHON_GRAALVM_SUPPORT',
            'extracted-dependency:graalpython:GRAALPYTHON_GRAALVM_DOCS',
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                destination='bin/<exe:graalpython>',
                jar_distributions=[
                    'dependency:graalpython:GRAALPYTHON-LAUNCHER'
                ],
                main_class='com.oracle.graal.python.shell.GraalPythonMain',
                build_args=[
                    '--language:python',
                    '--language:llvm',
                ])
        ],
    ), _suite)
Exemple #7
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='TruffleRuby',
        short_name='rby',
        dir_name='ruby',
        license_files=['LICENSE_TRUFFLERUBY.md'],
        third_party_license_files=['3rd_party_licenses_truffleruby.txt'],
        truffle_jars=[
            'truffleruby:TRUFFLERUBY', 'truffleruby:TRUFFLERUBY-SHARED',
            'truffleruby:TRUFFLERUBY-ANNOTATIONS'
        ],
        support_distributions=[
            'truffleruby:TRUFFLERUBY_GRAALVM_SUPPORT',
        ],
        provided_executables=[
            'bin/gem',
            'bin/irb',
            'bin/rake',
            'bin/rdoc',
            'bin/ri',
            'bin/testrb',
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                destination='bin/<exe:truffleruby>',
                jar_distributions=['truffleruby:TRUFFLERUBY-LAUNCHER'],
                main_class='org.truffleruby.launcher.RubyLauncher',
                build_args=[
                    '--language:llvm',
                    '--language:ruby',
                ],
                links=['bin/<exe:ruby>'],
            )
        ],
    ))
Exemple #8
0
mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
    suite=_suite,
    name='Graal.js',
    short_name='js',
    standalone_dir_name='graaljs-<version>-<graalvm_os>-<arch>',
    standalone_dependencies={
        'GraalVM license files': ('', ['GRAALVM-README.md']),
    },
    license_files=['LICENSE_GRAALJS.txt'],
    third_party_license_files=['THIRD_PARTY_LICENSE_GRAALJS.txt'],
    dependencies=[
        'Truffle',
        'TRegex',
        'ICU4J',
    ],
    truffle_jars=[
        'graal-js:GRAALJS',
    ],
    support_distributions=[
        'graal-js:GRAALJS_GRAALVM_SUPPORT',
    ],
    library_configs=[
        mx_sdk.LanguageLibraryConfig(
            launchers=['bin/<exe:js>'],
            jar_distributions=['graal-js:GRAALJS_LAUNCHER'],
            main_class='com.oracle.truffle.js.shell.JSLauncher',
            build_args=['-H:+TruffleCheckBlockListMethods'],
            build_args_enterprise=[
                '-H:+AuxiliaryEngineCache',
                '-H:ReservedAuxiliaryImageBytes=2145482548',
            ] if not mx.is_windows() else [],
            language='js',
        )
    ],
    boot_jars=['graal-js:GRAALJS_SCRIPTENGINE'],
    installable=True,
    stability="supported",
))
Exemple #9
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='TruffleSqueak',
        short_name='st',
        dir_name=LANGUAGE_ID,
        license_files=[],  # already included in `TRUFFLESQUEAK_HOME`.
        third_party_license_files=[],
        dependencies=['Truffle'],
        truffle_jars=[
            'trufflesqueak:TRUFFLESQUEAK',
            'trufflesqueak:TRUFFLESQUEAK_SHARED',
        ],
        support_distributions=[
            'trufflesqueak:TRUFFLESQUEAK_HOME',
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                language=LANGUAGE_ID,
                destination='bin/<exe:trufflesqueak>',
                jar_distributions=['trufflesqueak:TRUFFLESQUEAK_LAUNCHER'],
                main_class='%s.launcher.TruffleSqueakLauncher' % PACKAGE_NAME,
                extra_jvm_args=BASE_VM_ARGS,
                build_args=[
                    # '--pgo-instrument',  # (uncomment to enable profiling)
                    # '--pgo',  # (uncomment to recompile with profiling info)
                ],
            )
        ],
        post_install_msg=
        (None if not _svm else "\nNOTES:\n---------------\n" +
         "TruffleSqueak (SVM) requires SDL2 to be installed on your system:\n"
         +
         "- On Debian/Ubuntu, you can install SDL2 via `sudo apt-get install libsdl2-2.0`.\n"
         +
         "- On macOS, you can install SDL2 with Homebrew: `brew install sdl2`.\n\n"
         +
         "The pre-compiled native image is used by default and does not include other languages. "
         +
         "Run TruffleSqueak in JVM mode (via `trufflesqueak --jvm`) for polyglot access."
         ),
    ))
Exemple #10
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.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='GraalVM Chrome Inspector',
        short_name='ins',
        dir_name='chromeinspector',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['tools:CHROMEINSPECTOR'],
        support_distributions=['tools:CHROMEINSPECTOR_GRAALVM_SUPPORT'],
        include_by_default=True,
    ))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='GraalVM Profiler',
        short_name='pro',
        dir_name='profiler',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['tools:TRUFFLE_PROFILER'],
Exemple #11
0
        maven_args += ['install']
    else:
        maven_args += [
            '-DaltDeploymentRepository={}::default::{}'.format(repo.name, repo.get_url(svmVersion)),
            'deploy'
        ]
    mx.run_maven(maven_args, cwd=proj_dir)


mx_sdk.register_graalvm_component(mx_sdk.GraalVmJreComponent(
    suite=suite,
    name='SubstrateVM',
    short_name='svm',
    license_files=[],
    third_party_license_files=[],
    jar_distributions=['substratevm:LIBRARY_SUPPORT'],
    builder_jar_distributions=[
        'substratevm:SVM',
        'substratevm:OBJECTFILE',
        'substratevm:POINTSTO',
    ],
    support_distributions=['substratevm:SVM_GRAALVM_SUPPORT'],
))

mx_sdk.register_graalvm_component(mx_sdk.GraalVmJreComponent(
    suite=suite,
    name='Native Image',
    short_name='ni',
    dir_name='svm',
    installable_id='native-image',
    license_files=[],
    third_party_license_files=[],
Exemple #12
0
mx_unittest.add_config_participant(_unittest_config_participant)

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='trufflex86',
        short_name='vmx86',
        dir_name='amd64',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=[
            'trufflex86:VM', 'trufflex86:VM_MEMORY_SVM', 'trufflex86:CORE',
            'trufflex86:POSIX'
        ],
        support_distributions=['trufflex86:VMX86_GRAALVM_SUPPORT'],
        polyglot_lib_build_args=[
            '-H:CLibraryPath=<path:VMX86_GRAALVM_SUPPORT>/clibraries/<os>-<arch>'
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                destination='bin/<exe:vmx86>',
                jar_distributions=['trufflex86:VMX86_LAUNCHER'],
                main_class='org.graalvm.vm.x86.launcher.AMD64Launcher',
                build_args=[
                    '-H:CLibraryPath=<path:VMX86_GRAALVM_SUPPORT>/clibraries/<os>-<arch>'
                ],
                language='amd64')
        ],
    ))

mx.update_commands(
Exemple #13
0
        content = "\n".join(content.split("\n")[1:])
        # modify SuppressWarnings to remove useless entries
        content = PTRN_SUPPRESS_WARNINGS.sub('@SuppressWarnings("all")', content)
        # remove useless casts
        content = PTRN_LOCALCTXT_CAST.sub('_localctx', content)
        content = PTRN_TOKEN_CAST.sub('_errHandler.recoverInline(this)', content)
        # add copyright header
        content = copyright_template.format(content)
        with open(filename, 'w') as content_file:
            content_file.write(content)

mx_sdk.register_graalvm_component(mx_sdk.GraalVmTool(
    suite=_suite,
    name='Truffle NFI',
    short_name='tfl',
    dir_name='truffle',
    license_files=[],
    third_party_license_files=[],
    truffle_jars=[],
    support_distributions=[
        'truffle:TRUFFLE_GRAALVM_SUPPORT',
        'truffle:TRUFFLE_NFI_NATIVE',
    ]
))

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"],
})
Exemple #14
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='Graal.nodejs',
        short_name='njs',
        dir_name='nodejs',
        license_files=['LICENSE_GRAALNODEJS.txt'],
        third_party_license_files=['THIRD_PARTY_LICENSE_GRAALNODEJS.txt'],
        dependencies=['Graal.js'],
        truffle_jars=['graal-nodejs:TRUFFLENODE'],
        support_distributions=['graal-nodejs:TRUFFLENODE_GRAALVM_SUPPORT'],
        provided_executables=[
            'bin/<exe:node>',
            'bin/<cmd:npm>',
            'bin/<cmd:npx>',
        ],
        polyglot_lib_build_args=['--language:nodejs'],
        polyglot_lib_jar_dependencies=['graal-nodejs:TRUFFLENODE'],
        library_configs=[
            mx_sdk_vm.LibraryConfig(
                destination='lib/<lib:graal-nodejs>',
                jar_distributions=['graal-nodejs:TRUFFLENODE'],
                build_args=[
                    '--tool:all',
                    '--language:nodejs',
                    '-Dgraalvm.libpolyglot=true',  # `lib:graal-nodejs` should be initialized like `lib:polyglot` (GR-10038)
                ],
                home_finder=True,
            ),
        ],
        has_polyglot_lib_entrypoints=True,
        installable=True,
        stability="supported",
    ))
Exemple #15
0
        "CXX": "com.oracle.truffle.llvm.toolchain.launchers.ClangXX",
    },
    suite=_suite)

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='Sulong',
        short_name='slg',
        dir_name='llvm',
        license_files=[],
        third_party_license_files=[],
        dependencies=['Truffle', 'Truffle NFI', 'LLVM.org toolchain'],
        truffle_jars=['sulong:SULONG', 'sulong:SULONG_API'],
        support_distributions=[
            'sulong:SULONG_HOME',
            'sulong:SULONG_GRAALVM_DOCS',
        ],
        launcher_configs=[
            mx_sdk.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()))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmJreComponent(
        suite=_suite,
Exemple #16
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_fastr_suite,
        name='FastR',
        short_name='R',
        license_files=['LICENSE_FASTR'],
        third_party_license_files=['3rd_party_licenses_fastr.txt'],
        truffle_jars=['fastr:FASTR'],
        support_distributions=['fastr:FASTR_GRAALVM_SUPPORT'],
        provided_executables=[
            'bin/Rscript',
            'bin/R',
        ],
        include_in_polyglot=False,
        post_install_msg="NOTES:\n---------------\n" +
        "Some R packages need a system-dependent configuration before they can be installed. "
        +
        "A generic configuration that works out of the box in most cases is provided by default. "
        +
        "If you wish to fine-tune the configuration to your system or should you encounter any "
        +
        "issues during R package installation, try running the following script that adjusts "
        + "the configuration to your system: \n" +
        "    ${graalvm_home}/jre/languages/R/bin/configure_fastr\n\n" +
        "The R component comes without native image by default. If you wish to build the native image, "
        +
        "which provides faster startup, but slightly slower peak performance, then run the following:\n"
        + "   ${graalvm_home}/jre/languages/R/bin/install_r_native_image\n\n" +
        "The native image is then used by default. Pass '--jvm' flag to the R or Rscript launcher to "
        +
        "use JVM instead of the native image. Note that the native image is not stable yet and is intended for evaluation "
        +
        "purposes and experiments. Some features may not work when the native image is installed, most notably the --polyglot switch. "
        +
        "The native image can be uninstalled using the installation script with 'uninstall' argument.\n\n"
        +
        "See http://www.graalvm.org/docs/reference-manual/languages/r for more."
    ))
Exemple #17
0
        ]
    mx.run_maven(maven_args, cwd=proj_dir)


mx_sdk.register_graalvm_component(mx_sdk.GraalVmJreComponent(
    suite=suite,
    name='SubstrateVM',
    short_name='svm',
    license_files=[],
    third_party_license_files=[],
    jar_distributions=['substratevm:LIBRARY_SUPPORT'],
    builder_jar_distributions=[
        'substratevm:SVM',
        'substratevm:OBJECTFILE',
        'substratevm:POINTSTO',
    ],
    support_distributions=['substratevm:SVM_GRAALVM_SUPPORT'],
    launcher_configs=[
        mx_sdk.LauncherConfig(
            destination="bin/native-image",
            jar_distributions=["substratevm:SVM_DRIVER"],
            main_class="com.oracle.svm.driver.NativeImage",
            build_args=[
                "-H:-ParseRuntimeOptions",
            ]
        )
    ],
))


mx_sdk.register_graalvm_component(mx_sdk.GraalVmJreComponent(
    suite=suite,
Exemple #18
0
    ]
    mx.log('\n'.join(success_message))


mx_sdk.register_graalvm_component(mx_sdk.GraalVmJreComponent(
    suite=suite,
    name='SubstrateVM',
    short_name='svm',
    license_files=[],
    third_party_license_files=[],
    jar_distributions=['substratevm:LIBRARY_SUPPORT'],
    builder_jar_distributions=[
        'substratevm:SVM',
        'substratevm:OBJECTFILE',
        'substratevm:POINTSTO',
    ],
    support_distributions=['substratevm:SVM_GRAALVM_SUPPORT'],
    launcher_configs=[
        mx_sdk.LauncherConfig(
            destination="bin/native-image",
            jar_distributions=["substratevm:SVM_DRIVER"],
            main_class="com.oracle.svm.driver.NativeImage",
            build_args=[
                "-H:-ParseRuntimeOptions",
            ]
        )
    ],
))


mx_sdk.register_graalvm_component(mx_sdk.GraalVmJreComponent(
    suite=suite,
Exemple #19
0
import mx
import mx_sdk
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.register_graalvm_component(
    mx_sdk.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)
Exemple #20
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.register_graalvm_component(mx_sdk.GraalVmTool(
    suite=_suite,
    name='GraalVM Chrome Inspector',
    short_name='ins',
    dir_name='chromeinspector',
    license_files=[],
    third_party_license_files=[],
    truffle_jars=['tools:CHROMEINSPECTOR'],
    support_distributions=['tools:CHROMEINSPECTOR_GRAALVM_SUPPORT'],
    include_by_default=True,
))

mx_sdk.register_graalvm_component(mx_sdk.GraalVmTool(
    suite=_suite,
    name='GraalVM Profiler',
    short_name='pro',
    dir_name='profiler',
    license_files=[],
    third_party_license_files=[],
    truffle_jars=['tools:TRUFFLE_PROFILER'],
    support_distributions=['tools:TRUFFLE_PROFILER_GRAALVM_SUPPORT'],
Exemple #21
0
mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
    suite=_suite,
    name='Graal.js',
    short_name='js',
    standalone_dir_name='graaljs-<version>-<os>-<arch>',
    standalone_dependencies={
        'GraalVM license files': ('', ['GRAALVM-README.md']),
    },
    license_files=[],
    third_party_license_files=[],
    dependencies=['Truffle', 'TRegex'],
    truffle_jars=[
        'graal-js:GRAALJS',
        'graal-js:ICU4J',
        'graal-js:ASM-7.1',
        'graal-js:ASM_TREE-7.1',
        'graal-js:ASM_ANALYSIS-7.1',
        'graal-js:ASM_COMMONS-7.1',
        'graal-js:ASM_UTIL-7.1',
    ],
    support_distributions=[
        'graal-js:GRAALJS_GRAALVM_SUPPORT',
    ],
    launcher_configs=[
        mx_sdk.LanguageLauncherConfig(
            destination='bin/<exe:js>',
            jar_distributions=['graal-js:GRAALJS_LAUNCHER'],
            main_class='com.oracle.truffle.js.shell.JSLauncher',
            build_args=['-H:+TruffleCheckBlackListedMethods'],
            language='js',
        )
    ],
    boot_jars=['graal-js:GRAALJS_SCRIPTENGINE'],
))
Exemple #22
0
        if t:
            unittest([
                '--suite', 'tools', '--enable-timing', '--verbose',
                '--fail-fast'
            ])


mx_gate.add_gate_runner(_suite, _tools_gate_runner)

mx_sdk.register_graalvm_component(
    mx_sdk.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.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='AgentScript',
        short_name='ats',
        dir_name='agentscript',
        license_files=[],
        third_party_license_files=[],
Exemple #23
0
        return [join(_suite.dir, f) for f in self.doc_files]


mx_benchmark.add_bm_suite(mx_sulong_benchmarks.SulongBenchmarkSuite())

mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
    suite=_suite,
    name='Sulong',
    short_name='slg',
    dir_name='llvm',
    license_files=[],
    third_party_license_files=[],
    truffle_jars=['sulong:SULONG'],
    support_distributions=[
        'sulong:SULONG_LIBS',
        'sulong:SULONG_GRAALVM_DOCS',
    ],
    launcher_configs=[
        mx_sdk.LanguageLauncherConfig(
            destination='bin/<exe:lli>',
            jar_distributions=['sulong:SULONG_LAUNCHER'],
            main_class='com.oracle.truffle.llvm.launcher.LLVMLauncher',
            build_args=['--language:llvm']
        )
    ],
))

COPYRIGHT_HEADER_BSD = """\
/*
 * Copyright (c) 2016, 2018, Oracle and/or its affiliates.
 *
Exemple #24
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_fastr_suite,
        name='FastR',
        short_name='R',
        license_files=['LICENSE_FASTR'],
        third_party_license_files=['3rd_party_licenses_fastr.txt'],
        dependencies=['Truffle', 'LLVM Runtime Native', 'LLVM.org toolchain'],
        truffle_jars=['fastr:FASTR'],
        support_distributions=['fastr:FASTR_GRAALVM_SUPPORT'],
        provided_executables=[
            'bin/Rscript',
            'bin/R',
        ],
        include_in_polyglot=False,
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                destination='bin/RMain',
                jar_distributions=['fastr:FASTR_LAUNCHER'],
                main_class='com.oracle.truffle.r.launcher.RMain',
                build_args=[],
                language='R',
                is_main_launcher=False,
                default_symlinks=False,
            )
        ],
        stability="experimental",
        post_install_msg="NOTES:\n---------------\n" +
        "FastR should work out of the box on most Linux distributions and recent MacOS versions. "
        +
        "Run the following script to check FastR requirements and create a personal R packages library directory: \n"
        + "    ${graalvm_languages_dir}/R/bin/configure_fastr\n\n" +
        "The R component comes without native image by default. If you wish to build the native image, "
        +
        "which provides faster startup, but slightly slower peak performance, then run the following:\n"
        + "    gu rebuild-images R\n\n" +
        "The native image is then used by default. Pass '--jvm' flag to the R or Rscript launcher to "
        +
        "use JVM instead of the native image. Note that the native image is not stable yet and is intended for evaluation "
        +
        "and experiments for curious users. Some features may not work in the native image mode. "
        +
        "Most notably, the --polyglot switch works only in JVM mode (when --jvm is used).\n\n"
        +
        "See http://www.graalvm.org/docs/reference-manual/languages/r for more."
    ))
Exemple #25
0
# register as a GraalVM language
#
# ----------------------------------------------------------------------------------------------------------------------
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='Graal.Python',
        short_name='pyn',
        dir_name='python',
        license_files=['LICENSE_GRAALPYTHON'],
        third_party_license_files=['3rd_party_licenses_graalpython.txt'],
        truffle_jars=[
            'graalpython:GRAALPYTHON',
        ],
        support_distributions=[
            'graalpython:GRAALPYTHON_GRAALVM_SUPPORT',
            'graalpython:GRAALPYTHON_GRAALVM_DOCS',
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                destination='bin/<exe:graalpython>',
                jar_distributions=['graalpython:GRAALPYTHON-LAUNCHER'],
                main_class='com.oracle.graal.python.shell.GraalPythonMain',
                build_args=[
                    '--language:python',
                    '--language:llvm',
                ])
        ],
    ))

# ----------------------------------------------------------------------------------------------------------------------
#
Exemple #26
0
mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmLanguage(
        suite=_suite,
        name='TruffleSqueak',
        short_name='st',
        dir_name=LANGUAGE_ID,
        license_files=[],  # already included in `TRUFFLESQUEAK_GRAALVM_SUPPORT`.
        third_party_license_files=[],
        truffle_jars=[
            'trufflesqueak:TRUFFLESQUEAK',
            'trufflesqueak:TRUFFLESQUEAK_SHARED',
        ],
        support_distributions=[
            'trufflesqueak:TRUFFLESQUEAK_GRAALVM_SUPPORT',
        ],
        launcher_configs=[
            mx_sdk.LanguageLauncherConfig(
                language=LANGUAGE_ID,
                destination='bin/<exe:trufflesqueak>',
                jar_distributions=['trufflesqueak:TRUFFLESQUEAK_LAUNCHER'],
                main_class='%s.launcher.TruffleSqueakLauncher' % PACKAGE_NAME,
                extra_jvm_args=BASE_VM_ARGS,
                build_args=[
                    # '--pgo-instrument',  # (uncomment to enable profiling)
                    # '--pgo',  # (uncomment to recompile with profiling info)
                ],
            )
        ],
        post_install_msg=None,
    ))
Exemple #27
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.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='GraalVM Chrome Inspector',
        short_name='ins',
        dir_name='chromeinspector',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['tools:CHROMEINSPECTOR'],
        support_distributions=['tools:CHROMEINSPECTOR_GRAALVM_SUPPORT'],
        include_by_default=True,
    ))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='GraalVM Profiler',
        short_name='pro',
        dir_name='profiler',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['tools:TRUFFLE_PROFILER'],
Exemple #28
0
    for language_flag in requested:
        version = requested[language_flag]
        truffle_language_ensure(language_flag, version, early_exit=early_exit)


mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmJreComponent(
        suite=suite,
        name='SubstrateVM',
        short_name='svm',
        license_files=[],
        third_party_license_files=[],
        support_distributions=['substratevm:SVM_GRAALVM_SUPPORT'
                               ],  # TODO needs support? or could be jars?
        launcher_configs=[
            mx_sdk.LauncherConfig(
                destination="bin/native-image",
                jar_distributions=["substratevm:SVM_DRIVER"],
                main_class="com.oracle.svm.driver.NativeImage",
                build_args=[
                    "-H:-ParseRuntimeOptions",
                ])
        ],
    ))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmJreComponent(
        suite=suite,
        name='Polyglot.Native',
        short_name='polynative',
Exemple #29
0
 mx_sdk.register_graalvm_component(
     mx_sdk.GraalVmLanguage(
         suite=_fastr_suite,
         name='FastR',
         short_name='R',
         license_files=['LICENSE_FASTR'],
         third_party_license_files=['3rd_party_licenses_fastr.txt'],
         dependencies=['Truffle', 'Sulong', 'LLVM.org toolchain'],
         truffle_jars=['fastr:FASTR'],
         support_distributions=['fastr:FASTR_GRAALVM_SUPPORT'],
         provided_executables=[
             'bin/Rscript',
             'bin/R',
         ],
         include_in_polyglot=False,
         post_install_msg="NOTES:\n---------------\n" +
         "FastR needs a system-dependent configuration because it links with some system libraries. "
         +
         "A generic configuration that works out of the box on most Linux distributions with GCC and gfortran installed is provided by default. "
         +
         "If you are on another system (e.g., MacOS), wish to fine-tune the configuration to your system, or should you encounter any "
         +
         "issues when running FastR or during R packages installation, try running the following script that adjusts "
         + "the configuration to your system: \n" +
         "    ${graalvm_languages_dir}/R/bin/configure_fastr\n\n" +
         "The user specific library directory was not created automatically. "
         +
         "You can either create the directory manually or edit file ${graalvm_languages_dir}/R/etc/Renviron to change it to any desired location. "
         +
         "Without the user specific library directory, users will need write permission for the GraalVM home directory in order to install R packages. "
         + "\n\n" +
         "The R component comes without native image by default. If you wish to build the native image, "
         +
         "which provides faster startup, but slightly slower peak performance, then run the following:\n"
         + "    ${graalvm_languages_dir}/R/bin/install_r_native_image\n\n" +
         "The native image is then used by default. Pass '--jvm' flag to the R or Rscript launcher to "
         +
         "use JVM instead of the native image. Note that the native image is not stable yet and is intended for evaluation "
         +
         "purposes and experiments. Some features may not work in the native image mode, most notably some Rcpp based packages. "
         +
         "The native image can be uninstalled using the installation script with 'uninstall' argument.\n\n"
         +
         "See http://www.graalvm.org/docs/reference-manual/languages/r for more."
     ))
Exemple #30
0
        self.delegate.logBuild()
        self.delegate.build()

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


mx_sdk.register_graalvm_component(
    mx_sdk.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',
        ],
    ))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVMSvmMacro(
        suite=_suite,
        name='Truffle Macro',
        short_name='tflm',
        dir_name='truffle',
Exemple #31
0
    spotbugsArgs = ['-textui', '-low', '-longBugCodes', '-include', filters]
    if mx.is_interactive():
        spotbugsArgs.append('-progress')
    mx_spotbugs.spotbugs(args, spotbugsArgs)

def verify_ci(args):
    """Verify CI configuration"""
    mx.verify_ci(args, mx.suite('truffle'), _suite, 'common.json')

mx_sdk.register_graalvm_component(mx_sdk.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,
))

mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
    suite=_suite,
    name='TruffleRuby',
    short_name='rby',
    dir_name='ruby',
    standalone_dir_name='truffleruby-<version>-<graalvm_os>-<arch>',
    license_files=[],
    third_party_license_files=[],
Exemple #32
0
    testJalangi(args +["--all"]);

@contextmanager
def _import_substratevm():
    try:
        import mx_substratevm
    except:
        mx.abort("Cannot import 'mx_substratevm'. Did you forget to dynamically import SubstrateVM?")
    yield mx_substratevm

mx_sdk.register_graalvm_component(mx_sdk.GraalVmTool(
    suite=_suite,
    name='NodeProf',
    short_name='np',
    dir_name='nodeprof',
    license_files=[],
    third_party_license_files=[],
    truffle_jars=['nodeprof:NODEPROF'],
    support_distributions=['nodeprof:NODEPROF_GRAALVM_SUPPORT'],
    include_by_default=True,
))

def mx_post_parse_cmd_line(args):
    try:
        import mx_substratevm
        mx_substratevm.tools_map['nodeprof'] = mx_substratevm.ToolDescriptor(image_deps=['nodeprof:NODEPROF'])
    except:
        pass # SubstrateVM is not available

mx.update_commands(_suite, {
    'test-all': [test, ''],
Exemple #33
0
        ]
        for patch in self.subject.patches:
            mx.run(git_apply + [patch], cwd=self.subject.suite.vc_dir)

        self.delegate.logBuild()
        self.delegate.build()

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


mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='Truffle',
        short_name='tfl',
        dir_name='truffle',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=['truffle:TRUFFLE_NFI'],
        support_distributions=['truffle:TRUFFLE_GRAALVM_SUPPORT']))

mx_sdk.register_graalvm_component(
    mx_sdk.GraalVmTool(
        suite=_suite,
        name='Truffle NFI',
        short_name='nfi',
        dir_name='nfi',
        license_files=[],
        third_party_license_files=[],
        truffle_jars=[],
        support_distributions=['truffle:TRUFFLE_NFI_GRAALVM_SUPPORT']))
import mx_sdk

_suite = mx.suite("mozart-graal")

mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
    suite=_suite,
    name="Mozart-Graal",
    short_name="moz",
    dir_name="oz",
    license_files=["LICENSE_MOZART_GRAAL.txt"],
    third_party_license_files=[],
    truffle_jars=[
        "mozart-graal:MOZART_GRAAL",
    ],
    support_distributions=[
        "mozart-graal:MOZART_GRAAL_GRAALVM_SUPPORT",
    ],
    provided_executables=[],
    launcher_configs=[
        mx_sdk.LanguageLauncherConfig(
            destination="bin/<exe:oz>",
            jar_distributions=[
                "mozart-graal:MOZART_GRAAL_LAUNCHER",
            ],
            main_class="org.mozartoz.truffle.OzLauncher",
            build_args=["--language:oz"],
            links=[],
        )
    ]
))