Skip to content

Commit e2a1e26

Browse files
committed
[GR-52637] [GR-52644] Make jcodings dependency optional.
PullRequest: graal/17225
2 parents e9daa58 + 325f610 commit e2a1e26

File tree

36 files changed

+759
-377
lines changed

36 files changed

+759
-377
lines changed

espresso/mx.espresso/suite.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,12 @@
359359
"name" : "org.graalvm.espresso",
360360
"exports": [
361361
"com.oracle.truffle.espresso.runtime.staticobject", # Workaround GR-48132
362-
]
362+
],
363+
"requires": [
364+
"org.graalvm.collections",
365+
"org.graalvm.nativeimage",
366+
"org.graalvm.polyglot",
367+
],
363368
},
364369
"description" : "Core module of the Java on Truffle (aka Espresso): a Java bytecode interpreter",
365370
"subDir": "src",

regex/mx.regex/suite.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@
140140
"requires" : [
141141
"java.logging",
142142
"jdk.unsupported", # sun.misc.Unsafe
143+
"org.graalvm.collections",
144+
"org.graalvm.polyglot",
143145
],
144146
},
145147
"subDir" : "src",
@@ -161,6 +163,9 @@
161163
"TREGEX_TEST_DUMMY_LANG" : {
162164
"moduleInfo" : {
163165
"name" : "com.oracle.truffle.regex.test.dummylang",
166+
"requires": [
167+
"org.graalvm.truffle",
168+
],
164169
},
165170
"subDir" : "src",
166171
"dependencies" : ["com.oracle.truffle.regex.test.dummylang"],

sdk/mx.sdk/suite.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,10 @@ class UniversalDetector {
961961
"exports" : [
962962
"org.graalvm.nativebridge",
963963
],
964+
"requires": [
965+
"org.graalvm.collections",
966+
"org.graalvm.nativeimage",
967+
],
964968
},
965969
"subDir" : "src",
966970
"dependencies" : ["org.graalvm.nativebridge"],

substratevm/mx.substratevm/macro-truffle.properties

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Args = --features=com.oracle.svm.truffle.TruffleFeature \
44
--features=com.oracle.svm.truffle.TruffleJFRFeature \
55
--features=org.graalvm.home.HomeFinderFeature \
66
--initialize-at-build-time=com.oracle.truffle \
7-
--initialize-at-build-time=org.graalvm.shadowed.org.jcodings \
87
--initialize-at-build-time=org.graalvm.jniutils \
98
--initialize-at-build-time=org.graalvm.nativebridge \
109
--initialize-at-build-time=org.graalvm.shadowed.org.json \
@@ -49,13 +48,4 @@ JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleR
4948
--add-exports org.graalvm.truffle/com.oracle.truffle.host=ALL-UNNAMED \
5049
--add-exports org.graalvm.truffle/com.oracle.truffle.object=ALL-UNNAMED \
5150
--add-exports org.graalvm.truffle/com.oracle.truffle.object.basic=ALL-UNNAMED \
52-
--add-exports org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
53-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings=ALL-UNNAMED \
54-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.ascii=ALL-UNNAMED \
55-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.constants=ALL-UNNAMED \
56-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.exception=ALL-UNNAMED \
57-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.specific=ALL-UNNAMED \
58-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.transcode=ALL-UNNAMED \
59-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.transcode.specific=ALL-UNNAMED \
60-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.unicode=ALL-UNNAMED \
61-
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.util=ALL-UNNAMED
51+
--add-exports org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED

substratevm/mx.substratevm/suite.py

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,12 @@
14751475
"requires": [
14761476
"java.management",
14771477
"jdk.management",
1478+
"transitive org.graalvm.nativeimage",
1479+
"transitive org.graalvm.nativeimage.base",
1480+
"transitive org.graalvm.nativeimage.objectfile",
1481+
"transitive org.graalvm.nativeimage.pointsto",
1482+
"org.graalvm.collections",
1483+
"org.graalvm.truffle.compiler",
14781484
],
14791485
"uses" : [
14801486
"org.graalvm.nativeimage.Platform",
@@ -1542,6 +1548,9 @@
15421548
"com.oracle.svm.jvmtiagentbase",
15431549
"com.oracle.svm.jvmtiagentbase.jvmti",
15441550
],
1551+
"requires": [
1552+
"org.graalvm.nativeimage.builder",
1553+
],
15451554
},
15461555
"maven": False,
15471556
},
@@ -1562,6 +1571,9 @@
15621571
"exports" : [
15631572
"* to org.graalvm.nativeimage.builder",
15641573
],
1574+
"requires": [
1575+
"jdk.graal.compiler",
1576+
],
15651577
},
15661578
"noMavenJavadoc": True,
15671579
"maven": {
@@ -1622,7 +1634,10 @@
16221634
"sun.nio.ch",
16231635
"jdk.internal.ref",
16241636
],
1625-
}
1637+
},
1638+
"requires": [
1639+
"org.graalvm.collections",
1640+
],
16261641
},
16271642
"noMavenJavadoc": True,
16281643
"maven": {
@@ -1677,6 +1692,10 @@
16771692
# the module can still be used with the TruffleBaseFeature
16781693
"static org.graalvm.truffle.runtime",
16791694
"static org.graalvm.jniutils",
1695+
"jdk.graal.compiler",
1696+
"org.graalvm.collections",
1697+
"org.graalvm.polyglot",
1698+
"org.graalvm.truffle.compiler",
16801699
],
16811700
"uses" : [
16821701
"com.oracle.truffle.api.TruffleLanguage.Provider",
@@ -1816,6 +1835,8 @@
18161835
"org.graalvm.nativeimage.builder",
18171836
"java.management",
18181837
"jdk.management",
1838+
"jdk.graal.compiler",
1839+
"org.graalvm.collections",
18191840
],
18201841
},
18211842
"maven": False,
@@ -1843,7 +1864,12 @@
18431864
"jdk.internal.vm.ci" : [
18441865
"jdk.vm.ci.meta",
18451866
],
1846-
}
1867+
},
1868+
"requires": [
1869+
"jdk.graal.compiler",
1870+
"org.graalvm.collections",
1871+
"org.graalvm.nativeimage.builder",
1872+
],
18471873
},
18481874
# vm: included as binary, tool descriptor intentionally not copied
18491875
"maven": False,
@@ -1864,6 +1890,9 @@
18641890
"exports" : [
18651891
"com.oracle.svm.diagnosticsagent",
18661892
],
1893+
"requires": [
1894+
"org.graalvm.nativeimage.builder",
1895+
],
18671896
},
18681897
"maven": False,
18691898
},
@@ -1885,6 +1914,11 @@
18851914
"com.oracle.svm.configure",
18861915
"com.oracle.svm.configure.command",
18871916
],
1917+
"requires": [
1918+
"jdk.graal.compiler",
1919+
"org.graalvm.collections",
1920+
"org.graalvm.nativeimage.builder",
1921+
],
18881922
},
18891923
"maven": False,
18901924
},
@@ -1904,7 +1938,12 @@
19041938
],
19051939
"moduleInfo" : {
19061940
"name" : "org.graalvm.nativeimage.base",
1907-
"requires" : ["java.sql", "java.xml"],# workaround for GR-47773 on the module-path which requires java.sql (like truffle) or java.xml
1941+
"requires" : [
1942+
# workaround for GR-47773 on the module-path which requires java.sql (like truffle) or java.xml
1943+
"java.sql",
1944+
"java.xml",
1945+
"org.graalvm.collections",
1946+
],
19081947
"exports" : [
19091948
"com.oracle.svm.util to org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.librarysupport,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.llvm,org.graalvm.nativeimage.agent.jvmtibase,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.agent.diagnostics,org.graalvm.nativeimage.junitsupport,com.oracle.svm.svm_enterprise,com.oracle.svm_enterprise.ml_dataset,org.graalvm.extraimage.builder,com.oracle.svm.extraimage_enterprise,org.graalvm.extraimage.librarysupport,org.graalvm.nativeimage.foreign,org.graalvm.truffle.runtime.svm,com.oracle.truffle.enterprise.svm",
19101949
"com.oracle.svm.common.meta to org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.llvm,org.graalvm.extraimage.builder,org.graalvm.nativeimage.foreign,org.graalvm.truffle.runtime.svm,com.oracle.truffle.enterprise.svm",
@@ -1954,6 +1993,8 @@
19541993
"requires": [
19551994
"java.management",
19561995
"jdk.management",
1996+
"org.graalvm.collections",
1997+
"org.graalvm.nativeimage",
19571998
],
19581999
"requiresConcealed" : {
19592000
"java.management": [
@@ -1994,6 +2035,7 @@
19942035
"requires": [
19952036
"java.management",
19962037
"jdk.management",
2038+
"org.graalvm.nativeimage",
19972039
],
19982040
"requiresConcealed" : {
19992041
"java.management": [

substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -651,8 +651,8 @@ public boolean processMetaInfResource(Path classpathEntry, Path resourceRoot, Pa
651651
ModuleFinder finder = ModuleFinder.of(classpathEntry);
652652
ModuleReference ref = finder.find(forceOnModulePath).orElse(null);
653653
if (ref == null) {
654-
throw showError("Failed to process ForceOnModulePath attribute: No module descriptor was not found in class-path entry: " +
655-
classpathEntry + ".");
654+
throw showError("Failed to process ForceOnModulePath attribute: Module descriptor for the module " + forceOnModulePath +
655+
" was not found in class-path entry: " + classpathEntry + ".");
656656
}
657657
} catch (FindException e) {
658658
throw showError("Failed to process ForceOnModulePath attribute: Module descriptor for the module " + forceOnModulePath +

sulong/mx.sulong/suite.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,10 @@
16831683
"com.oracle.truffle.llvm.runtime.config.ConfigurationFactory",
16841684
"com.oracle.truffle.llvm.spi.internal.LLVMResourceProvider",
16851685
],
1686+
"requires": [
1687+
"org.graalvm.collections",
1688+
"org.graalvm.polyglot",
1689+
],
16861690
},
16871691
"useModulePath" : True,
16881692
"subDir" : "projects",
@@ -1768,6 +1772,11 @@
17681772
"exports" : [
17691773
"* to org.graalvm.llvm.nativemode",
17701774
],
1775+
"requires": [
1776+
"org.graalvm.collections",
1777+
"org.graalvm.polyglot",
1778+
"org.graalvm.truffle",
1779+
],
17711780
},
17721781
"useModulePath" : True,
17731782
"subDir" : "projects",
@@ -1832,6 +1841,9 @@
18321841
"exports" : [
18331842
"com.oracle.truffle.llvm.launcher to org.graalvm.launcher",
18341843
],
1844+
"requires": [
1845+
"org.graalvm.polyglot",
1846+
],
18351847
},
18361848
"useModulePath" : True,
18371849
"subDir" : "projects",

tools/mx.tools/suite.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@
364364
# This distribution defines a module.
365365
"moduleInfo" : {
366366
"name" : "com.oracle.truffle.tools.chromeinspector",
367+
"requires": [
368+
"org.graalvm.collections",
369+
"org.graalvm.polyglot",
370+
],
367371
},
368372
"dependencies": ["com.oracle.truffle.tools.chromeinspector"],
369373
"distDependencies" : [
@@ -421,6 +425,10 @@
421425
"exports" : [
422426
"org.graalvm.tools.insight"
423427
],
428+
"requires": [
429+
"org.graalvm.polyglot",
430+
"org.graalvm.collections",
431+
],
424432
},
425433
"dependencies": [
426434
"org.graalvm.tools.insight",
@@ -453,6 +461,10 @@
453461
# This distribution defines a module.
454462
"moduleInfo" : {
455463
"name" : "org.graalvm.tools.insight.heap",
464+
"requires": [
465+
"org.graalvm.collections",
466+
"org.graalvm.polyglot",
467+
],
456468
},
457469
"dependencies": [
458470
"org.graalvm.tools.insight.heap"
@@ -521,6 +533,9 @@
521533
# chromeinspector and smoke tests use CPUSampler
522534
"com.oracle.truffle.tools.profiler",
523535
],
536+
"requires": [
537+
"org.graalvm.polyglot",
538+
],
524539
},
525540
"dependencies": [
526541
"com.oracle.truffle.tools.profiler",
@@ -577,6 +592,9 @@
577592
# This distribution defines a module.
578593
"moduleInfo" : {
579594
"name" : "com.oracle.truffle.tools.coverage",
595+
"requires": [
596+
"org.graalvm.polyglot",
597+
],
580598
},
581599
"dependencies": [
582600
"com.oracle.truffle.tools.coverage",
@@ -634,6 +652,10 @@
634652
# This distribution defines a module.
635653
"moduleInfo" : {
636654
"name" : "com.oracle.truffle.tools.dap",
655+
"requires": [
656+
"org.graalvm.collections",
657+
"org.graalvm.polyglot",
658+
],
637659
},
638660
"dependencies": [
639661
"com.oracle.truffle.tools.dap",
@@ -717,6 +739,11 @@
717739
# This distribution defines a module.
718740
"moduleInfo" : {
719741
"name" : "org.graalvm.tools.lsp",
742+
"requires": [
743+
"org.graalvm.collections",
744+
"org.graalvm.polyglot",
745+
"org.graalvm.truffle",
746+
],
720747
},
721748
"dependencies": [
722749
"org.graalvm.tools.api.lsp",

truffle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This changelog summarizes major changes between Truffle versions relevant to lan
1010
* GR-52443 Removed many deprecated `DynamicObject` APIs, deprecated since 22.2 or earlier (`Shape` methods: `addProperty`, `defineProperty`, `removeProperty`, `replaceProperty`, `newInstance`, `createFactory`, `getObjectType`, `changeType`, `getLayout`, `getMutex`, `getParent`, `allocator`, and related interfaces; `Property.set*`, `*Location` methods: `getInternal`, `setInternal`, `set*`, `getType`, and `ObjectLocation`).
1111
* GR-51136 Uninitialized static slots of a `Frame` can now be read, and returns the default value for the access kind.
1212
* GR-38322 Added `--engine.TraceMissingSafepointPollInterval=N` to show Java stacktraces when there are [missing `TruffleSafepoint.poll()` calls](https://github.com/oracle/graal/blob/master/truffle/docs/Safepoints.md#find-missing-safepoint-polls).
13+
* GR-52644 Deprecated `TruffleLanguage.Registration.needsAllEncodings`, no longer needs to be declared. It is sufficient for a language module to require `org.graalvm.shadowed.jcodings` to enable all string encodings.
1314

1415
## Version 24.0.0
1516

truffle/external_repos/simplelanguage/language/src/test/java/module-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
requires org.graalvm.polyglot;
4545
requires junit;
4646
requires org.graalvm.truffle;
47-
requires org.graalvm.shadowed.jcodings;
4847
requires org.graalvm.sl;
4948
exports com.oracle.truffle.sl.test;
5049

0 commit comments

Comments
 (0)