Exemplo n.º 1
0
def mx_register_dynamic_suite_constituents(register_project, register_distribution):
    """Conditionally creates the ESPRESSO_LLVM_SUPPORT distribution if a Java home with LLVM bitcode is provided.
    :type register_project: (mx.Project) -> None
    :type register_distribution: (mx.Distribution) -> None
    """
    if LLVM_JAVA_HOME:
        lib_prefix = mx.add_lib_prefix('')
        lib_suffix = mx.add_lib_suffix('')
        lib_path = join(LLVM_JAVA_HOME, 'lib')
        libraries = [join(lib_path, name) for name in os.listdir(lib_path) if name.startswith(lib_prefix) and name.endswith(lib_suffix)]
        register_distribution(mx.LayoutTARDistribution(_suite, 'ESPRESSO_LLVM_SUPPORT', [], {
            "lib/llvm/default/":
                ["file:" + lib for lib in libraries] +
                ["file:{}/release".format(LLVM_JAVA_HOME)],
        }, None, True, None))
Exemplo n.º 2
0
def mx_register_dynamic_suite_constituents(register_project,
                                           register_distribution):
    rffi = mx.get_env('FASTR_RFFI', '')
    fastr_release_distribution = mx.JARDistribution(
        suite=_fastr_suite,
        name="FASTR_RELEASE" + rffi,
        subDir=None,
        path="mxbuild/dists/<os>/<arch>/{rffi}/fastr-release.jar".format(
            rffi=rffi),
        sourcesPath=None,
        deps=["com.oracle.truffle.r.release"],
        mainClass=None,
        excludedLibs=[],
        distDependencies=[],
        javaCompliance=None,
        platformDependent=True,
        theLicense=None)
    fastr_release_distribution.description = "a binary release of FastR"

    fastr_graalvm_release = mx.NativeTARDistribution(
        suite=_fastr_suite,
        name="FASTR_GRAALVM_RELEASE" + rffi,
        deps=["com.oracle.truffle.r.release"],
        path=None,
        excludedLibs=[],
        platformDependent=True,
        theLicense=None,
        relpath=True,
        output=None,
        overlaps=["FASTR_RELEASE" + rffi])

    register_distribution(fastr_release_distribution)
    register_distribution(fastr_graalvm_release)

    if mx.get_env('FASTR_RELEASE') == 'true':
        fastr_graalvm_release_support = mx.LayoutTARDistribution(
            suite=_fastr_suite,
            name="FASTR_GRAALVM_SUPPORT" + rffi,
            deps=[],
            layout={
                "./": [
                    {
                        "source_type":
                        "extracted-dependency",
                        "dependency":
                        "FASTR_GRAALVM_RELEASE" + rffi,
                        "path":
                        "*",
                        "exclude": [
                            "COPYRIGHT",
                            "LICENSE",
                            "README.md",
                            "bin/Rscript",
                            "bin/fastr_jars",
                            "bin/exec/R",
                        ],
                    },
                    {
                        "source_type":
                        "extracted-dependency",
                        "dependency":
                        "FASTR_GRAALVM_RELEASE" + rffi,
                        "path":
                        "bin/fastr_jars/*",
                        "exclude": [
                            "bin/fastr_jars/fastr.jar",
                            "bin/fastr_jars/truffle*",
                            "bin/fastr_jars/graal-sdk*",
                        ],
                    },
                    "dependency:fastr:FASTR_LAUNCHER",
                ],
                "LICENSE_FASTR":
                "file:LICENSE",
                "3rd_party_licenses_fastr.txt":
                "file:3rd_party_licenses.txt",
                "README_FASTR":
                "extracted-dependency:fastr:FASTR_GRAALVM_RELEASE{rffi}/README.md"
                .format(rffi=rffi),
                "bin/Rscript":
                "file:com.oracle.truffle.r.release/src/Rscript_legacy",
                "bin/exec/R":
                "file:com.oracle.truffle.r.release/src/R_legacy",
                "native-image.properties":
                "file:mx.fastr/native-image.properties",
            },
            path=None,
            platformDependent=True,
            theLicense=None)
        fastr_graalvm_release_support.description = "FastR support distribution for the GraalVM"
        register_distribution(fastr_graalvm_release_support)
Exemplo n.º 3
0
def mx_register_dynamic_suite_constituents(register_project,
                                           register_distribution):
    fastr_graalvm_release = mx.NativeTARDistribution(
        suite=_fastr_suite,
        name="FASTR_GRAALVM_RELEASE",
        deps=["com.oracle.truffle.r.release"],
        path=None,
        excludedLibs=[],
        platformDependent=True,
        theLicense=None,
        relpath=True,
        output=None)
    register_distribution(fastr_graalvm_release)

    fastr_graalvm_release_support = mx.LayoutTARDistribution(
        suite=_fastr_suite,
        name="FASTR_GRAALVM_SUPPORT",
        deps=[],
        layout={
            "./": [
                {
                    "source_type":
                    "extracted-dependency",
                    "dependency":
                    "FASTR_GRAALVM_RELEASE",
                    "path":
                    "*",
                    "exclude": [
                        "COPYRIGHT",
                        "LICENSE",
                        "README.md",
                        "bin/Rscript",
                        "bin/fastr_jars",
                        "bin/exec/R",
                    ],
                },
                {
                    "source_type":
                    "extracted-dependency",
                    "dependency":
                    "FASTR_GRAALVM_RELEASE",
                    "path":
                    "bin/fastr_jars/*",
                    "exclude": [
                        "bin/fastr_jars/fastr.jar",
                        "bin/fastr_jars/truffle*",
                        "bin/fastr_jars/graal-sdk*",
                    ],
                },
                "dependency:fastr:FASTR_LAUNCHER",
            ],
            "LICENSE_FASTR":
            "file:LICENSE",
            "3rd_party_licenses_fastr.txt":
            "file:3rd_party_licenses.txt",
            "README_FASTR":
            "extracted-dependency:fastr:FASTR_GRAALVM_RELEASE/README.md",
            "bin/Rscript":
            "file:com.oracle.truffle.r.release/src/Rscript_launcher",
            "bin/exec/R":
            "file:com.oracle.truffle.r.release/src/R_launcher",
            "native-image.properties":
            "file:mx.fastr/native-image.properties",
        },
        path=None,
        platformDependent=True,
        theLicense=None)
    fastr_graalvm_release_support.description = "FastR support distribution for the GraalVM"
    register_distribution(fastr_graalvm_release_support)