27
27
import mx_sdk_vm
28
28
import mx_gate
29
29
30
- from mx_espresso import _espresso_stability , _has_native_espresso_standalone , _send_sigquit , get_java_home_dep , _jdk_lib_dir , jvm_standalone_with_llvm
30
+ from mx_espresso import _espresso_stability , _send_sigquit , get_java_home_dep , _jdk_lib_dir , jvm_standalone_with_llvm
31
31
from mx_sdk_vm_ng import _find_native_image_command , ThinLauncherProject # pylint: disable=unused-import
32
32
from mx_sdk_vm_impl import get_final_graalvm_distribution , has_component , graalvm_skip_archive
33
33
@@ -113,7 +113,7 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi
113
113
native = create_ni_standalone ('ESPRESSO_NATIVE_STANDALONE' , register_distribution )
114
114
jvm = create_ni_standalone ('ESPRESSO_JVM_STANDALONE' , register_distribution )
115
115
if not (native or jvm ):
116
- raise mx .abort ("Couldn't create any Espresso native-image standalone" )
116
+ mx .warn ("Couldn't create any Espresso native-image standalone" )
117
117
118
118
def _run_espresso_native_image_launcher (args , cwd = None , nonZeroIsFatal = True , out = None , err = None , timeout = None , mode = None ):
119
119
extra_args = ['-J--vm.' + arg for arg in mx_gate .get_jacoco_agent_args () or []]
@@ -139,10 +139,16 @@ def _run_espresso_native_image_launcher(args, cwd=None, nonZeroIsFatal=True, out
139
139
return mx .run ([native_image_command ] + extra_args + args , cwd = cwd , nonZeroIsFatal = nonZeroIsFatal , out = out , err = err , timeout = timeout , on_timeout = _send_sigquit )
140
140
141
141
def _detect_espresso_native_image_mode ():
142
- if _has_native_espresso_standalone () and exists (mx .distribution ('ESPRESSO_NI_NATIVE_STANDALONE' ).get_output ()):
142
+ native_dist = mx .distribution ('ESPRESSO_NI_NATIVE_STANDALONE' , fatalIfMissing = False )
143
+ jvm_dist = mx .distribution ('ESPRESSO_JVM_NATIVE_STANDALONE' , fatalIfMissing = False )
144
+ if native_dist and exists (native_dist .get_output ()):
143
145
return 'native'
144
- else :
146
+ elif jvm_dist and exists ( jvm_dist . get_output ()) :
145
147
return 'jvm'
148
+ elif jvm_dist or native_dist :
149
+ raise mx .abort ("No espresso Native Image Standalone is built" )
150
+ else :
151
+ raise mx .abort ("No espresso Native Image Standalone is available (see warnings above)" )
146
152
147
153
def _run_espresso_native_image_jvm_launcher (args , cwd = None , nonZeroIsFatal = True , out = None , err = None , timeout = None ):
148
154
return _run_espresso_native_image_launcher (args , cwd , nonZeroIsFatal , out , err , timeout , mode = 'jvm' )
0 commit comments