Skip to content

Commit 90d556e

Browse files
Automatic merge of master into galahad
2 parents 1997ea6 + aa5db3f commit 90d556e

File tree

6 files changed

+13
-54
lines changed

6 files changed

+13
-54
lines changed

substratevm/mx.substratevm/macro-junitcp.properties

-13
This file was deleted.

substratevm/mx.substratevm/mx_substratevm.py

+4-24
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ def batched(iterable, n):
645645
yield batch
646646

647647

648-
def _native_junit(native_image, unittest_args, build_args=None, run_args=None, blacklist=None, whitelist=None, preserve_image=False, force_builder_on_cp=False, test_classes_per_run=None):
648+
def _native_junit(native_image, unittest_args, build_args=None, run_args=None, blacklist=None, whitelist=None, preserve_image=False, test_classes_per_run=None):
649649
build_args = build_args or []
650650
javaProperties = {}
651651
for dist in suite.dists:
@@ -675,13 +675,7 @@ def dummy_harness(test_deps, vm_launcher, vm_args):
675675
mx.log('Building junit image for matching: ' + ' '.join(test_classes))
676676
extra_image_args = mx.get_runtime_jvm_args(unittest_deps, jdk=mx_compiler.jdk, exclude_names=mx_sdk_vm_impl.NativePropertiesBuildTask.implicit_excludes)
677677
macro_junit = '--macro:junit'
678-
if force_builder_on_cp:
679-
macro_junit += 'cp'
680-
custom_env = os.environ.copy()
681-
custom_env['USE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM'] = 'false'
682-
else:
683-
custom_env = None
684-
unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file] + svm_experimental_options(['-H:Path=' + junit_test_dir]), env=custom_env)
678+
unittest_image = native_image(['-ea', '-esa'] + build_args + extra_image_args + [macro_junit + '=' + unittest_file] + svm_experimental_options(['-H:Path=' + junit_test_dir]))
685679
image_pattern_replacement = unittest_image + ".exe" if mx.is_windows() else unittest_image
686680
run_args = [arg.replace('${unittest.image}', image_pattern_replacement) for arg in run_args]
687681
mx.log('Running: ' + ' '.join(map(shlex.quote, [unittest_image] + run_args)))
@@ -719,15 +713,14 @@ def unmask(args):
719713

720714
def _native_unittest(native_image, cmdline_args):
721715
parser = ArgumentParser(prog='mx native-unittest', description='Run unittests as native image.')
722-
all_args = ['--build-args', '--run-args', '--blacklist', '--whitelist', '-p', '--preserve-image', '--force-builder-on-cp', '--test-classes-per-run']
716+
all_args = ['--build-args', '--run-args', '--blacklist', '--whitelist', '-p', '--preserve-image', '--test-classes-per-run']
723717
cmdline_args = [_mask(arg, all_args) for arg in cmdline_args]
724718
parser.add_argument(all_args[0], metavar='ARG', nargs='*', default=[])
725719
parser.add_argument(all_args[1], metavar='ARG', nargs='*', default=[])
726720
parser.add_argument('--blacklist', help='run all testcases not specified in <file>', metavar='<file>')
727721
parser.add_argument('--whitelist', help='run testcases specified in <file> only', metavar='<file>')
728722
parser.add_argument('-p', '--preserve-image', help='do not delete the generated native image', action='store_true')
729723
parser.add_argument('--test-classes-per-run', help='run N test classes per image run, instead of all tests at once', nargs=1, type=int)
730-
parser.add_argument('--force-builder-on-cp', help='force image builder to run on classpath', action='store_true')
731724
parser.add_argument('unittest_args', metavar='TEST_ARG', nargs='*')
732725
pargs = parser.parse_args(cmdline_args)
733726

@@ -749,7 +742,7 @@ def _native_unittest(native_image, cmdline_args):
749742
mx.log('warning: could not read blacklist: ' + blacklist)
750743

751744
unittest_args = unmask(pargs.unittest_args) if unmask(pargs.unittest_args) else ['com.oracle.svm.test', 'com.oracle.svm.configure.test']
752-
_native_junit(native_image, unittest_args, unmask(pargs.build_args), unmask(pargs.run_args), blacklist, whitelist, pargs.preserve_image, pargs.force_builder_on_cp, test_classes_per_run)
745+
_native_junit(native_image, unittest_args, unmask(pargs.build_args), unmask(pargs.run_args), blacklist, whitelist, pargs.preserve_image, test_classes_per_run)
753746

754747

755748
def jvm_unittest(args):
@@ -1467,19 +1460,6 @@ def _native_image_launcher_extra_jvm_args():
14671460
jlink=False,
14681461
))
14691462

1470-
mx_sdk_vm.register_graalvm_component(mx_sdk_vm.GraalVMSvmMacro(
1471-
suite=suite,
1472-
name='Native Image JUnit with image-builder on classpath',
1473-
short_name='njucp',
1474-
dir_name='junitcp',
1475-
license_files=[],
1476-
third_party_license_files=[],
1477-
dependencies=['SubstrateVM'],
1478-
jar_distributions=['substratevm:JUNIT_SUPPORT', 'mx:JUNIT_TOOL', 'mx:JUNIT', 'mx:HAMCREST'],
1479-
support_distributions=['substratevm:NATIVE_IMAGE_JUNITCP_SUPPORT'],
1480-
jlink=False,
1481-
))
1482-
14831463
libgraal_jar_distributions = [
14841464
'sdk:NATIVEBRIDGE',
14851465
'sdk:JNIUTILS',

substratevm/mx.substratevm/suite.py

-9
Original file line numberDiff line numberDiff line change
@@ -2327,15 +2327,6 @@
23272327
},
23282328
},
23292329

2330-
"NATIVE_IMAGE_JUNITCP_SUPPORT" : {
2331-
"native" : True,
2332-
"description" : "Native-image based junit testing support but with running image-builder on classpath",
2333-
"layout" : {
2334-
"native-image.properties" : "file:mx.substratevm/macro-junitcp.properties",
2335-
"svm-junit.packages" : "file:mx.substratevm/svm-junit.packages",
2336-
},
2337-
},
2338-
23392330
"SVM_FOREIGN": {
23402331
"subDir": "src",
23412332
"description" : "SubstrateVM support for the Foreign API",

truffle/src/com.oracle.truffle.polyglot/src/com/oracle/truffle/polyglot/InternalResourceCache.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ final class InternalResourceCache {
9595

9696
/**
9797
* Recomputed before the analyses by a substitution in the {@code TruffleBaseFeature} based on
98-
* the {@code CopyLanguageResources} option value. The field must not be declared as
99-
* {@code final} to make the substitution function correctly.
98+
* the {@code CopyLanguageResources} option value. The field must not qualify as a Java language
99+
* constant (as defined in JLS 15.28) to prevent the Java compiler from inlining its value.
100100
*/
101-
private static boolean useInternalResources = true;
101+
private static final boolean useInternalResources = Boolean.TRUE.booleanValue();
102102
private static boolean useExternalDirectoryInNativeImage = true;
103103

104104
private final String id;
@@ -292,8 +292,9 @@ private static String sanitize(String pathElement) {
292292
}
293293

294294
/**
295-
* Returns true if internal resources are enabled. Internal resources can be disabled in the
296-
* native image using {-H:-CopyLanguageResources} option.
295+
* Returns true if internal resources are enabled. Internal resources are disabled in the native
296+
* image when both the copying and inclusion of language resources are turned off. This can be
297+
* achieved by using the {@code -H:-IncludeLanguageResources} option.
297298
*/
298299
public static boolean usesInternalResources() {
299300
return useInternalResources;

vm/mx.vm/ce-test

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
DYNAMIC_IMPORTS=/compiler,/graal-js,/regex,/sdk,/substratevm,/tools,/truffle
2-
COMPONENTS=cmp,cov,dap,dis,gvm,icu4j,ins,insight,insightheap,lg,llp,lsp,nfi-libffi,ni,nic,nil,nju,njucp,pro,rgx,sdk,sdkl,tfl,tfla,tflc,tflm,truffle-json
2+
COMPONENTS=cmp,cov,dap,dis,gvm,icu4j,ins,insight,insightheap,lg,llp,lsp,nfi-libffi,ni,nic,nil,nju,pro,rgx,sdk,sdkl,tfl,tfla,tflc,tflm,truffle-json
33
NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-flang,graalvm-native-ld,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image
44
DISABLE_INSTALLABLES=llp

vm/mx.vm/mx_vm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def local_path_to_url(args):
170170
mx_sdk_vm.register_vm_config('ce', llvm_components + ['antlr4', 'sllvmvm', 'bnative-image', 'cmp', 'lg', 'llrc', 'llrl', 'llrlf', 'llrn', 'nfi-libffi', 'nfi', 'ni', 'nil', 'pbm', 'pbi', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file='polybench-sulong-ce')
171171

172172
if mx.get_os() == 'windows':
173-
mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'njucp', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False)
173+
mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False)
174174
else:
175-
mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'njucp', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'svml', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False)
175+
mx_sdk_vm.register_vm_config('svm', ['bnative-image', 'bnative-image-configure', 'cmp', 'gvm', 'nfi-libffi', 'nfi', 'ni', 'nil', 'nju', 'nic', 'rgx', 'sdk', 'sdkni', 'sdkc', 'sdkl', 'snative-image-agent', 'snative-image-diagnostics-agent', 'svm', 'svmt', 'svmnfi', 'svmsl', 'svml', 'tfl', 'tfla', 'tflc', 'tflm'], _suite, env_file=False)
176176
# pylint: enable=line-too-long
177177

178178

0 commit comments

Comments
 (0)