2727import mx_sdk_vm
2828import mx_gate
2929
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
3131from mx_sdk_vm_ng import _find_native_image_command , ThinLauncherProject # pylint: disable=unused-import
3232from mx_sdk_vm_impl import get_final_graalvm_distribution , has_component , graalvm_skip_archive
3333
@@ -113,7 +113,7 @@ def mx_register_dynamic_suite_constituents(register_project, register_distributi
113113 native = create_ni_standalone ('ESPRESSO_NATIVE_STANDALONE' , register_distribution )
114114 jvm = create_ni_standalone ('ESPRESSO_JVM_STANDALONE' , register_distribution )
115115 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" )
117117
118118def _run_espresso_native_image_launcher (args , cwd = None , nonZeroIsFatal = True , out = None , err = None , timeout = None , mode = None ):
119119 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
139139 return mx .run ([native_image_command ] + extra_args + args , cwd = cwd , nonZeroIsFatal = nonZeroIsFatal , out = out , err = err , timeout = timeout , on_timeout = _send_sigquit )
140140
141141def _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 ()):
143145 return 'native'
144- else :
146+ elif jvm_dist and exists ( jvm_dist . get_output ()) :
145147 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)" )
146152
147153def _run_espresso_native_image_jvm_launcher (args , cwd = None , nonZeroIsFatal = True , out = None , err = None , timeout = None ):
148154 return _run_espresso_native_image_launcher (args , cwd , nonZeroIsFatal , out , err , timeout , mode = 'jvm' )
0 commit comments