Skip to content

Commit

Permalink
[GR-52637] [GR-52644] Make jcodings dependency optional.
Browse files Browse the repository at this point in the history
PullRequest: graal/17225
  • Loading branch information
woess committed Mar 28, 2024
2 parents e9daa58 + 325f610 commit e2a1e26
Show file tree
Hide file tree
Showing 36 changed files with 759 additions and 377 deletions.
7 changes: 6 additions & 1 deletion espresso/mx.espresso/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,12 @@
"name" : "org.graalvm.espresso",
"exports": [
"com.oracle.truffle.espresso.runtime.staticobject", # Workaround GR-48132
]
],
"requires": [
"org.graalvm.collections",
"org.graalvm.nativeimage",
"org.graalvm.polyglot",
],
},
"description" : "Core module of the Java on Truffle (aka Espresso): a Java bytecode interpreter",
"subDir": "src",
Expand Down
5 changes: 5 additions & 0 deletions regex/mx.regex/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
"requires" : [
"java.logging",
"jdk.unsupported", # sun.misc.Unsafe
"org.graalvm.collections",
"org.graalvm.polyglot",
],
},
"subDir" : "src",
Expand All @@ -161,6 +163,9 @@
"TREGEX_TEST_DUMMY_LANG" : {
"moduleInfo" : {
"name" : "com.oracle.truffle.regex.test.dummylang",
"requires": [
"org.graalvm.truffle",
],
},
"subDir" : "src",
"dependencies" : ["com.oracle.truffle.regex.test.dummylang"],
Expand Down
4 changes: 4 additions & 0 deletions sdk/mx.sdk/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,10 @@ class UniversalDetector {
"exports" : [
"org.graalvm.nativebridge",
],
"requires": [
"org.graalvm.collections",
"org.graalvm.nativeimage",
],
},
"subDir" : "src",
"dependencies" : ["org.graalvm.nativebridge"],
Expand Down
12 changes: 1 addition & 11 deletions substratevm/mx.substratevm/macro-truffle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Args = --features=com.oracle.svm.truffle.TruffleFeature \
--features=com.oracle.svm.truffle.TruffleJFRFeature \
--features=org.graalvm.home.HomeFinderFeature \
--initialize-at-build-time=com.oracle.truffle \
--initialize-at-build-time=org.graalvm.shadowed.org.jcodings \
--initialize-at-build-time=org.graalvm.jniutils \
--initialize-at-build-time=org.graalvm.nativebridge \
--initialize-at-build-time=org.graalvm.shadowed.org.json \
Expand Down Expand Up @@ -49,13 +48,4 @@ JavaArgs = -Dtruffle.TruffleRuntime=com.oracle.svm.truffle.api.SubstrateTruffleR
--add-exports org.graalvm.truffle/com.oracle.truffle.host=ALL-UNNAMED \
--add-exports org.graalvm.truffle/com.oracle.truffle.object=ALL-UNNAMED \
--add-exports org.graalvm.truffle/com.oracle.truffle.object.basic=ALL-UNNAMED \
--add-exports org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.ascii=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.constants=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.exception=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.specific=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.transcode=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.transcode.specific=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.unicode=ALL-UNNAMED \
--add-exports org.graalvm.shadowed.jcodings/org.graalvm.shadowed.org.jcodings.util=ALL-UNNAMED
--add-exports org.graalvm.truffle/com.oracle.truffle.polyglot=ALL-UNNAMED
48 changes: 45 additions & 3 deletions substratevm/mx.substratevm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,12 @@
"requires": [
"java.management",
"jdk.management",
"transitive org.graalvm.nativeimage",
"transitive org.graalvm.nativeimage.base",
"transitive org.graalvm.nativeimage.objectfile",
"transitive org.graalvm.nativeimage.pointsto",
"org.graalvm.collections",
"org.graalvm.truffle.compiler",
],
"uses" : [
"org.graalvm.nativeimage.Platform",
Expand Down Expand Up @@ -1542,6 +1548,9 @@
"com.oracle.svm.jvmtiagentbase",
"com.oracle.svm.jvmtiagentbase.jvmti",
],
"requires": [
"org.graalvm.nativeimage.builder",
],
},
"maven": False,
},
Expand All @@ -1562,6 +1571,9 @@
"exports" : [
"* to org.graalvm.nativeimage.builder",
],
"requires": [
"jdk.graal.compiler",
],
},
"noMavenJavadoc": True,
"maven": {
Expand Down Expand Up @@ -1622,7 +1634,10 @@
"sun.nio.ch",
"jdk.internal.ref",
],
}
},
"requires": [
"org.graalvm.collections",
],
},
"noMavenJavadoc": True,
"maven": {
Expand Down Expand Up @@ -1677,6 +1692,10 @@
# the module can still be used with the TruffleBaseFeature
"static org.graalvm.truffle.runtime",
"static org.graalvm.jniutils",
"jdk.graal.compiler",
"org.graalvm.collections",
"org.graalvm.polyglot",
"org.graalvm.truffle.compiler",
],
"uses" : [
"com.oracle.truffle.api.TruffleLanguage.Provider",
Expand Down Expand Up @@ -1816,6 +1835,8 @@
"org.graalvm.nativeimage.builder",
"java.management",
"jdk.management",
"jdk.graal.compiler",
"org.graalvm.collections",
],
},
"maven": False,
Expand Down Expand Up @@ -1843,7 +1864,12 @@
"jdk.internal.vm.ci" : [
"jdk.vm.ci.meta",
],
}
},
"requires": [
"jdk.graal.compiler",
"org.graalvm.collections",
"org.graalvm.nativeimage.builder",
],
},
# vm: included as binary, tool descriptor intentionally not copied
"maven": False,
Expand All @@ -1864,6 +1890,9 @@
"exports" : [
"com.oracle.svm.diagnosticsagent",
],
"requires": [
"org.graalvm.nativeimage.builder",
],
},
"maven": False,
},
Expand All @@ -1885,6 +1914,11 @@
"com.oracle.svm.configure",
"com.oracle.svm.configure.command",
],
"requires": [
"jdk.graal.compiler",
"org.graalvm.collections",
"org.graalvm.nativeimage.builder",
],
},
"maven": False,
},
Expand All @@ -1904,7 +1938,12 @@
],
"moduleInfo" : {
"name" : "org.graalvm.nativeimage.base",
"requires" : ["java.sql", "java.xml"],# workaround for GR-47773 on the module-path which requires java.sql (like truffle) or java.xml
"requires" : [
# workaround for GR-47773 on the module-path which requires java.sql (like truffle) or java.xml
"java.sql",
"java.xml",
"org.graalvm.collections",
],
"exports" : [
"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",
"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",
Expand Down Expand Up @@ -1954,6 +1993,8 @@
"requires": [
"java.management",
"jdk.management",
"org.graalvm.collections",
"org.graalvm.nativeimage",
],
"requiresConcealed" : {
"java.management": [
Expand Down Expand Up @@ -1994,6 +2035,7 @@
"requires": [
"java.management",
"jdk.management",
"org.graalvm.nativeimage",
],
"requiresConcealed" : {
"java.management": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -651,8 +651,8 @@ public boolean processMetaInfResource(Path classpathEntry, Path resourceRoot, Pa
ModuleFinder finder = ModuleFinder.of(classpathEntry);
ModuleReference ref = finder.find(forceOnModulePath).orElse(null);
if (ref == null) {
throw showError("Failed to process ForceOnModulePath attribute: No module descriptor was not found in class-path entry: " +
classpathEntry + ".");
throw showError("Failed to process ForceOnModulePath attribute: Module descriptor for the module " + forceOnModulePath +
" was not found in class-path entry: " + classpathEntry + ".");
}
} catch (FindException e) {
throw showError("Failed to process ForceOnModulePath attribute: Module descriptor for the module " + forceOnModulePath +
Expand Down
12 changes: 12 additions & 0 deletions sulong/mx.sulong/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,10 @@
"com.oracle.truffle.llvm.runtime.config.ConfigurationFactory",
"com.oracle.truffle.llvm.spi.internal.LLVMResourceProvider",
],
"requires": [
"org.graalvm.collections",
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"subDir" : "projects",
Expand Down Expand Up @@ -1768,6 +1772,11 @@
"exports" : [
"* to org.graalvm.llvm.nativemode",
],
"requires": [
"org.graalvm.collections",
"org.graalvm.polyglot",
"org.graalvm.truffle",
],
},
"useModulePath" : True,
"subDir" : "projects",
Expand Down Expand Up @@ -1832,6 +1841,9 @@
"exports" : [
"com.oracle.truffle.llvm.launcher to org.graalvm.launcher",
],
"requires": [
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"subDir" : "projects",
Expand Down
27 changes: 27 additions & 0 deletions tools/mx.tools/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@
# This distribution defines a module.
"moduleInfo" : {
"name" : "com.oracle.truffle.tools.chromeinspector",
"requires": [
"org.graalvm.collections",
"org.graalvm.polyglot",
],
},
"dependencies": ["com.oracle.truffle.tools.chromeinspector"],
"distDependencies" : [
Expand Down Expand Up @@ -421,6 +425,10 @@
"exports" : [
"org.graalvm.tools.insight"
],
"requires": [
"org.graalvm.polyglot",
"org.graalvm.collections",
],
},
"dependencies": [
"org.graalvm.tools.insight",
Expand Down Expand Up @@ -453,6 +461,10 @@
# This distribution defines a module.
"moduleInfo" : {
"name" : "org.graalvm.tools.insight.heap",
"requires": [
"org.graalvm.collections",
"org.graalvm.polyglot",
],
},
"dependencies": [
"org.graalvm.tools.insight.heap"
Expand Down Expand Up @@ -521,6 +533,9 @@
# chromeinspector and smoke tests use CPUSampler
"com.oracle.truffle.tools.profiler",
],
"requires": [
"org.graalvm.polyglot",
],
},
"dependencies": [
"com.oracle.truffle.tools.profiler",
Expand Down Expand Up @@ -577,6 +592,9 @@
# This distribution defines a module.
"moduleInfo" : {
"name" : "com.oracle.truffle.tools.coverage",
"requires": [
"org.graalvm.polyglot",
],
},
"dependencies": [
"com.oracle.truffle.tools.coverage",
Expand Down Expand Up @@ -634,6 +652,10 @@
# This distribution defines a module.
"moduleInfo" : {
"name" : "com.oracle.truffle.tools.dap",
"requires": [
"org.graalvm.collections",
"org.graalvm.polyglot",
],
},
"dependencies": [
"com.oracle.truffle.tools.dap",
Expand Down Expand Up @@ -717,6 +739,11 @@
# This distribution defines a module.
"moduleInfo" : {
"name" : "org.graalvm.tools.lsp",
"requires": [
"org.graalvm.collections",
"org.graalvm.polyglot",
"org.graalvm.truffle",
],
},
"dependencies": [
"org.graalvm.tools.api.lsp",
Expand Down
1 change: 1 addition & 0 deletions truffle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This changelog summarizes major changes between Truffle versions relevant to lan
* 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`).
* GR-51136 Uninitialized static slots of a `Frame` can now be read, and returns the default value for the access kind.
* 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).
* 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.

## Version 24.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
requires org.graalvm.polyglot;
requires junit;
requires org.graalvm.truffle;
requires org.graalvm.shadowed.jcodings;
requires org.graalvm.sl;
exports com.oracle.truffle.sl.test;

Expand Down
1 change: 0 additions & 1 deletion truffle/mx.truffle/mx_truffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,6 @@ def clean(self, forBuild=False):
'sdk:JNIUTILS',
'truffle:TRUFFLE_API',
'truffle:TRUFFLE_RUNTIME',
'truffle:TRUFFLE_JCODINGS',
],
stability="supported",
))
Expand Down
Loading

0 comments on commit e2a1e26

Please sign in to comment.