From e7bd622adb6f03a48f5a04d7d8360e33cbb7e652 Mon Sep 17 00:00:00 2001 From: Danilo Ansaloni <danilo.ansaloni@oracle.com> Date: Sat, 7 Apr 2018 19:18:35 +0200 Subject: [PATCH] Fix FastR suite registration. --- mx.fastr/mx_fastr_dists.py | 22 ++++++++++++++++------ mx.fastr/suite.py | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mx.fastr/mx_fastr_dists.py b/mx.fastr/mx_fastr_dists.py index 22b48e852c..d158385a3b 100644 --- a/mx.fastr/mx_fastr_dists.py +++ b/mx.fastr/mx_fastr_dists.py @@ -201,27 +201,37 @@ def mx_post_parse_cmd_line(opts): val = os.environ['FASTR_RFFI'] else: val = "" - mx.instantiateDistribution('FASTR_RELEASE<rffi>', dict(rffi=val)) - if os.environ.has_key('FASTR_RELEASE') and val == '': - mx.instantiateDistribution('FASTR_GRAALVM_SUPPORT<rffi>', dict(rffi=val)) + if not mx.distribution('FASTR_RELEASE{}'.format(val), fatalIfMissing=False): + mx.instantiateDistribution('FASTR_RELEASE<rffi>', dict(rffi=val)) for dist in mx_fastr._fastr_suite.dists: if isinstance(dist, mx.JARDistribution): dist.set_archiveparticipant(FastRArchiveParticipant(dist)) +def _instantiate_graalvm_support_dist(): + if os.environ.has_key('FASTR_RFFI'): + mx.abort('Cannot instantiate the GraalVM support distribution when \'FASTR_RFFI\' is set. Found: \'{}\''.format(os.environ.has_key('FASTR_RFFI'))) + if not os.environ.has_key('FASTR_RELEASE'): + mx.abort('Cannot instantiate the GraalVM support distribution when \'FASTR_RELEASE\' is not set.') + if not mx.distribution('FASTR_RELEASE', fatalIfMissing=False): + mx.instantiateDistribution('fastr:FASTR_RELEASE<rffi>', dict(rffi='')) + if not mx.distribution('fastr:FASTR_GRAALVM_SUPPORT', fatalIfMissing=False): + mx.instantiateDistribution('fastr:FASTR_GRAALVM_SUPPORT<rffi>', dict(rffi='')) + mx_sdk.register_component(mx_sdk.GraalVmLanguage( name='FastR', id='R', - documentation_files=['extracted-dependency:fastr:FASTR_GRAALVM_SUPPORT<rffi>/README_FASTR'], + documentation_files=['extracted-dependency:fastr:FASTR_GRAALVM_SUPPORT/README_FASTR'], license_files=[ 'link:<support>/COPYRIGHT_FASTR', 'link:<support>/LICENSE_FASTR', ], third_party_license_files=[], truffle_jars=['dependency:fastr:FASTR'], - support_distributions=['extracted-dependency:fastr:FASTR_GRAALVM_SUPPORT<rffi>'], + support_distributions=['extracted-dependency:fastr:FASTR_GRAALVM_SUPPORT'], provided_executables=[ 'link:<support>/bin/Rscript', 'link:<support>/bin/exec/R', - ] + ], + instantiate_dist=_instantiate_graalvm_support_dist, )) diff --git a/mx.fastr/suite.py b/mx.fastr/suite.py index 8c0c108de8..3b7aa407e8 100644 --- a/mx.fastr/suite.py +++ b/mx.fastr/suite.py @@ -466,6 +466,7 @@ suite = { "dependency" : "FASTR_RELEASE<rffi>", "path" : "bin/fastr_jars/*", "exclude" : [ + "bin/fastr_jars/fastr.jar", "bin/fastr_jars/truffle*", "bin/fastr_jars/graal-sdk*", ], -- GitLab