Skip to content

Commit 1152923

Browse files
committed
Fix _native_unittest --force-builder-on-cp
1 parent 17f1ad9 commit 1152923

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

substratevm/mx.substratevm/mx_substratevm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,14 @@ def dummy_harness(test_deps, vm_launcher, vm_args):
591591
with open(unittest_file, 'r') as f:
592592
mx.log('Building junit image for matching: ' + ' '.join(l.rstrip() for l in f))
593593
extra_image_args = mx.get_runtime_jvm_args(unittest_deps, jdk=mx_compiler.jdk, exclude_names=['substratevm:LIBRARY_SUPPORT'])
594-
macro_junit = '--macro:junit' + ('cp' if force_builder_on_cp else '')
595-
unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file, '-H:Path=' + junit_test_dir])
594+
macro_junit = '--macro:junit'
595+
if force_builder_on_cp:
596+
macro_junit += 'cp'
597+
custom_env = os.environ.copy()
598+
custom_env['USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM'] = 'false'
599+
else:
600+
custom_env = None
601+
unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file, '-H:Path=' + junit_test_dir], env=custom_env)
596602
image_pattern_replacement = unittest_image + ".exe" if mx.is_windows() else unittest_image
597603
run_args = [arg.replace('${unittest.image}', image_pattern_replacement) for arg in run_args]
598604
mx.log('Running: ' + ' '.join(map(pipes.quote, [unittest_image] + run_args)))

0 commit comments

Comments
 (0)