From 31be89d91ff456cdccf9c694833d728fcf5a267c Mon Sep 17 00:00:00 2001 From: Loic Ottet Date: Fri, 27 Jun 2025 11:18:48 +0200 Subject: [PATCH] Integrate foreign configuration into reachability-metadata.json --- .../assets/foreign-config-schema-v0.1.0.json | 144 --------------- .../reachability-metadata-schema-v1.1.0.json | 164 ++++++++++++++++-- substratevm/CHANGELOG.md | 1 + .../svm/configure/ConfigurationFile.java | 2 +- .../svm/configure/ConfigurationParser.java | 2 +- .../configure/ForeignConfigurationParser.java | 6 +- .../config/ConfigurationFileCollection.java | 10 +- .../config/ForeignConfiguration.java | 16 +- .../core/configure/ConfigurationFiles.java | 10 -- .../svm/driver/metainf/MetaInfFileType.java | 1 - .../foreign/ForeignFunctionsFeature.java | 5 +- 11 files changed, 171 insertions(+), 190 deletions(-) diff --git a/docs/reference-manual/native-image/assets/foreign-config-schema-v0.1.0.json b/docs/reference-manual/native-image/assets/foreign-config-schema-v0.1.0.json index 42cdd780214b..e69de29bb2d1 100644 --- a/docs/reference-manual/native-image/assets/foreign-config-schema-v0.1.0.json +++ b/docs/reference-manual/native-image/assets/foreign-config-schema-v0.1.0.json @@ -1,144 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://raw.githubusercontent.com/oracle/graal/master/docs/reference-manual/native-image/assets/foreign-config-schema-v0.1.0.json", - "properties": { - "downcalls": { - "default": [], - "items": { - "properties": { - "condition": { - "$ref": "config-condition-schema-v1.0.0.json", - "title": "Condition under which the downcall stub should be registered" - }, - "returnType": { - "type": "string", - "title": "A memory layout definition (allows canonical layouts; see 'java.lang.foreign.Linker')" - }, - "parameterTypes": { - "default": [], - "items": { - "type": "string", - "title": "A memory layout definition (allows canonical layouts; see 'java.lang.foreign.Linker')" - }, - "type": "array", - "title": "List of the function descriptor's parameter types " - }, - "options": { - "type": "object", - "title": "Linker options (see 'java.lang.foreign.Linker.Option')", - "properties": { - "captureCallState": { - "type": "boolean", - "title": "Specifies if a call state should be captured. Which states to capture is determined at run time. See also: 'java.lang.foreign.Linker.Option.captureCallState'" - }, - "critical": { - "type": "object", - "title": "see 'java.lang.foreign.Linker.Option.critical'", - "properties": { - "allowHeapAccess": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "firstVariadicArg": { - "type": "integer", - "title": "see 'java.lang.foreign.Linker.Option.firstVariadicArg'" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "A function descriptor to be registered for a downcall" - }, - "type": "array", - "title": "List of function descriptors that should be registered for downcalls" - }, - "upcalls": { - "default": [], - "items": { - "properties": { - "condition": { - "$ref": "config-condition-schema-v1.0.0.json", - "title": "Condition under which the upcall stub should be registered" - }, - "returnType": { - "type": "string", - "title": "A memory layout definition (allows canonical layouts; see 'java.lang.foreign.Linker')" - }, - "parameterTypes": { - "default": [], - "items": { - "type": "string", - "title": "A memory layout definition (allows canonical layouts; see 'java.lang.foreign.Linker')" - }, - "type": "array", - "title": "List of the function descriptor's parameter types " - }, - "options": { - "type": "object", - "title": "Linker options (see 'java.lang.foreign.Linker.Option')", - "description": "Currently, no linker options are allowed for upcalls. This may change in future.", - "properties": { }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "A function descriptor to be registered for an upcall" - }, - "type": "array", - "title": "List of function descriptors that should be registered for upcalls" - }, - "directUpcalls": { - "default": [], - "items": { - "properties": { - "condition": { - "$ref": "config-condition-schema-v1.0.0.json", - "title": "Condition under which the direct upcall stub should be registered" - }, - "class": { - "type": "string", - "title": "Full-qualified class name (e.g. 'org.package.OuterClass$InnerClass')" - }, - "method": { - "type": "string", - "title": "Method name" - }, - "returnType": { - "type": "string", - "title": "A memory layout definition (allows canonical layouts; see 'java.lang.foreign.Linker')" - }, - "parameterTypes": { - "default": [], - "items": { - "type": "string", - "title": "A memory layout definition (allows canonical layouts; see 'java.lang.foreign.Linker')" - }, - "type": "array", - "title": "List of the function descriptor's parameter types " - }, - "options": { - "type": "object", - "title": "Linker options (see 'java.lang.foreign.Linker.Option')", - "description": "Currently, no linker options are allowed for direct upcalls. This may change in future.", - "properties": { }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "A Java method and function descriptor to be registered for a direct upcall" - }, - "type": "array", - "title": "List of Java methods and function descriptors that should be registered for direct upcalls" - } - }, - "type": "object", - "additionalProperties": false, - "title": "JSON schema for the FFM API configuration that GraalVM Native Image uses", - "description": "A description and examples for writing an FFM API configuration can be found at https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/ForeignInterface.md" -} diff --git a/docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.1.0.json b/docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.1.0.json index 9e3933791841..4229b63ccfcc 100644 --- a/docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.1.0.json +++ b/docs/reference-manual/native-image/assets/reachability-metadata-schema-v1.1.0.json @@ -157,6 +157,148 @@ ], "additionalProperties": false } + }, + "foreign": { + "properties": { + "downcalls": { + "default": [], + "items": { + "properties": { + "condition": { + "$ref": "config-condition-schema-v1.0.0.json", + "title": "Condition under which the downcall stub should be registered" + }, + "returnType": { + "type": "string", + "title": "Memory layout definition (allows canonical layouts; see `java.lang.foreign.Linker`)" + }, + "parameterTypes": { + "default": [], + "items": { + "type": "string", + "title": "Memory layout definition (allows canonical layouts; see `java.lang.foreign.Linker`)" + }, + "type": "array", + "title": "List of the function descriptor's parameter types" + }, + "options": { + "type": "object", + "title": "Linker options (see `java.lang.foreign.Linker.Option`)", + "properties": { + "captureCallState": { + "type": "boolean", + "title": "Specifies whether a call state should be captured. The specific states to capture are determined at run time. See also: `java.lang.foreign.Linker.Option.captureCallState`" + }, + "critical": { + "type": "object", + "title": "See `java.lang.foreign.Linker.Option.critical`", + "properties": { + "allowHeapAccess": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "firstVariadicArg": { + "type": "integer", + "title": "See `java.lang.foreign.Linker.Option.firstVariadicArg`" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "Function descriptor to be registered for a downcall" + }, + "type": "array", + "title": "List of function descriptors that should be registered for downcalls" + }, + "upcalls": { + "default": [], + "items": { + "properties": { + "condition": { + "$ref": "config-condition-schema-v1.0.0.json", + "title": "Condition under which the upcall stub should be registered" + }, + "returnType": { + "type": "string", + "title": "Memory layout definition (allows canonical layouts; see `java.lang.foreign.Linker`)" + }, + "parameterTypes": { + "default": [], + "items": { + "type": "string", + "title": "Memory layout definition (allows canonical layouts; see `java.lang.foreign.Linker`)" + }, + "type": "array", + "title": "List of the function descriptor's parameter types" + }, + "options": { + "type": "object", + "title": "Linker options (see `java.lang.foreign.Linker.Option`)", + "description": "Currently, no linker options are allowed for upcalls. This may change in the future.", + "properties": { }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "Function descriptor to be registered for an upcall" + }, + "type": "array", + "title": "List of function descriptors that should be registered for upcalls" + }, + "directUpcalls": { + "default": [], + "items": { + "properties": { + "condition": { + "$ref": "config-condition-schema-v1.0.0.json", + "title": "Condition under which the direct upcall stub should be registered" + }, + "class": { + "type": "string", + "title": "Fully-qualified class name (e.g. `org.package.OuterClass$InnerClass`)" + }, + "method": { + "type": "string", + "title": "Method name" + }, + "returnType": { + "type": "string", + "title": "Memory layout definition (allows canonical layouts; see `java.lang.foreign.Linker`)" + }, + "parameterTypes": { + "default": [], + "items": { + "type": "string", + "title": "Memory layout definition (allows canonical layouts; see `java.lang.foreign.Linker`)" + }, + "type": "array", + "title": "List of the function descriptor's parameter types " + }, + "options": { + "type": "object", + "title": "Linker options (see `java.lang.foreign.Linker.Option`)", + "description": "Currently, no linker options are allowed for direct upcalls. This may change in the future.", + "properties": { }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "Java method and function descriptor to be registered for a direct upcall" + }, + "type": "array", + "title": "List of Java methods and function descriptors that should be registered for direct upcalls" + } + }, + "type": "object", + "additionalProperties": false, + "title": "JSON schema for the FFM API configuration used by GraalVM Native Image", + "description": "For a description and examples of writing an FFM API configuration, see: https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/ForeignInterface.md" } }, "required": [], @@ -352,7 +494,7 @@ "type": "array", "default": [], "items": { - "title": "Fully qualified name of the interface defining the proxy class", + "title": "Fully-qualified name of the interface defining the proxy class", "type": "string" } }, @@ -362,27 +504,27 @@ "properties": { "declaringClass": { "title": "The class in which the lambda class is defined", - "type": "#/$defs/type" + "$ref": "#/$defs/type" }, "declaringMethod": { "title": "The method in which the lambda class is defined", - "type": "#/$defs/method", + "$ref": "#/$defs/method", "default": {} }, "interfaces": { "title": "Non-empty list of interfaces implemented by the lambda class", "type": "array", "items": { - "title": "Fully qualified name of the interface implemented by the lambda class", + "title": "Fully-qualified name of the interface implemented by the lambda class", "type": "string" } - }, - "required": [ - "declaringClass", - "interfaces" - ], - "additionalProperties": false - } + } + }, + "required": [ + "declaringClass", + "interfaces" + ], + "additionalProperties": false } }, "oneOf": [ diff --git a/substratevm/CHANGELOG.md b/substratevm/CHANGELOG.md index a3bcb772496d..87e127eddf45 100644 --- a/substratevm/CHANGELOG.md +++ b/substratevm/CHANGELOG.md @@ -32,6 +32,7 @@ This changelog summarizes major changes to GraalVM Native Image. Run-time initialization of security providers helps reduce image heap size by avoiding unnecessary objects inclusion. * (GR-48191) Enable lambda classes to be registered for reflection and serialization in _reachability-metadata.json_. The format is detailed [here](https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/ReachabilityMetadata.md). * (GR-54697) Parallelize debug info generation and add support for run-time debug info generation. `-H:+RuntimeDebugInfo` adds a run-time debug info generator into a native image for use with GDB. +* (GR-65773) Integrate Foreign Function and Memory (FFM) API metadata into _reachability-metadata.json_. ## GraalVM for JDK 24 (Internal Version 24.2.0) * (GR-59717) Added `DuringSetupAccess.registerObjectReachabilityHandler` to allow registering a callback that is executed when an object of a specified type is marked as reachable during heap scanning. diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationFile.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationFile.java index 3627e532f546..b5261213f59d 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationFile.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationFile.java @@ -44,7 +44,7 @@ public enum ConfigurationFile { DYNAMIC_PROXY("proxy", null, true, false), PREDEFINED_CLASSES_NAME("predefined-classes", null, true, false), /* Non-metadata categories */ - FOREIGN("foreign", FOREIGN_KEY, true, false), + FOREIGN("foreign", FOREIGN_KEY, true, true), SERIALIZATION_DENY("serialization-deny", null, false, false); public static final String LEGACY_FILE_NAME_SUFFIX = "-config.json"; diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationParser.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationParser.java index d01fb36bafd3..a98591503586 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ConfigurationParser.java @@ -128,7 +128,7 @@ public void parseAndRegister(Reader reader) throws IOException { public Object getFromGlobalFile(Object json, String key) { EconomicMap map = asMap(json, "top level of reachability metadata file must be an object"); - checkAttributes(map, "reachability metadata", Collections.emptyList(), List.of(REFLECTION_KEY, JNI_KEY, SERIALIZATION_KEY, RESOURCES_KEY, BUNDLES_KEY, "reason", "comment")); + checkAttributes(map, "reachability metadata", Collections.emptyList(), List.of(REFLECTION_KEY, JNI_KEY, SERIALIZATION_KEY, RESOURCES_KEY, BUNDLES_KEY, FOREIGN_KEY, "reason", "comment")); return map.get(key); } diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ForeignConfigurationParser.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ForeignConfigurationParser.java index c6f007cf077a..5116950f275d 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ForeignConfigurationParser.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/ForeignConfigurationParser.java @@ -46,7 +46,11 @@ public ForeignConfigurationParser(EnumSet parserOptio @Override public void parseAndRegister(Object json, URI origin) { - var topLevel = asMap(json, "first level of document must be a map"); + var foreignJson = getFromGlobalFile(json, FOREIGN_KEY); + if (foreignJson == null) { + return; + } + var topLevel = asMap(foreignJson, "first level of document must be a map"); checkAttributes(topLevel, "foreign methods categories", List.of(), List.of("downcalls", "upcalls", "directUpcalls")); var downcalls = asList(topLevel.get("downcalls", List.of()), "downcalls must be an array of function descriptor and linker options"); diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ConfigurationFileCollection.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ConfigurationFileCollection.java index 48af0c4f4898..da1caa043fca 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ConfigurationFileCollection.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ConfigurationFileCollection.java @@ -66,7 +66,6 @@ public ConfigurationFileCollection() { private final Set resourceConfigPaths = new LinkedHashSet<>(); private final Set serializationConfigPaths = new LinkedHashSet<>(); private final Set predefinedClassesConfigPaths = new LinkedHashSet<>(); - private final Set foreignConfigPaths = new LinkedHashSet<>(); private Set lockFilePaths; public void addDirectory(Path path) { @@ -77,7 +76,6 @@ public void addDirectory(Path path) { resourceConfigPaths.add(path.resolve(ConfigurationFile.RESOURCES.getFileName()).toUri()); serializationConfigPaths.add(path.resolve(ConfigurationFile.SERIALIZATION.getFileName()).toUri()); predefinedClassesConfigPaths.add(path.resolve(ConfigurationFile.PREDEFINED_CLASSES_NAME.getFileName()).toUri()); - foreignConfigPaths.add(path.resolve(ConfigurationFile.FOREIGN.getFileName()).toUri()); detectAgentLock(path.resolve(ConfigurationFile.LOCK_FILE_NAME), Files::exists, Path::toUri); } @@ -98,7 +96,6 @@ public void addDirectory(Function fileResolver) { addFile(resourceConfigPaths, fileResolver, ConfigurationFile.RESOURCES); addFile(serializationConfigPaths, fileResolver, ConfigurationFile.SERIALIZATION); addFile(predefinedClassesConfigPaths, fileResolver, ConfigurationFile.PREDEFINED_CLASSES_NAME); - addFile(foreignConfigPaths, fileResolver, ConfigurationFile.FOREIGN); detectAgentLock(fileResolver.apply(ConfigurationFile.LOCK_FILE_NAME), Objects::nonNull, Function.identity()); } @@ -128,7 +125,6 @@ public Set getPaths(ConfigurationFile configurationFile) { case REFLECTION -> uris = getReflectConfigPaths(); case SERIALIZATION -> uris = getSerializationConfigPaths(); case PREDEFINED_CLASSES_NAME -> uris = getPredefinedClassesConfigPaths(); - case FOREIGN -> uris = getForeignConfigPaths(); default -> throw new IllegalArgumentException("Cannot get paths for configuration file " + configurationFile); } return uris.stream().map(Paths::get).collect(Collectors.toSet()); @@ -162,10 +158,6 @@ public Set getPredefinedClassesConfigPaths() { return predefinedClassesConfigPaths; } - public Set getForeignConfigPaths() { - return foreignConfigPaths; - } - public TypeConfiguration loadReflectConfig(Function exceptionHandler) throws Exception { TypeConfiguration reflectConfig = loadTypeConfig(ConfigurationFile.REFLECTION, reflectConfigPaths, exceptionHandler); TypeConfiguration jniConfig = loadTypeConfig(ConfigurationFile.JNI, jniConfigPaths, exceptionHandler); @@ -187,7 +179,7 @@ public PredefinedClassesConfiguration loadPredefinedClassesConfig(List exceptionHandler) throws Exception { ForeignConfiguration foreignConfiguration = new ForeignConfiguration(); - loadConfig(foreignConfigPaths, foreignConfiguration.createParser(false, parserOptions), exceptionHandler); + loadConfig(reachabilityMetadataPaths, foreignConfiguration.createParser(true, parserOptions), exceptionHandler); return foreignConfiguration; } diff --git a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ForeignConfiguration.java b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ForeignConfiguration.java index a5fa946ec308..601bc49fbc23 100644 --- a/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ForeignConfiguration.java +++ b/substratevm/src/com.oracle.svm.configure/src/com/oracle/svm/configure/config/ForeignConfiguration.java @@ -270,7 +270,7 @@ public void printJson(JsonWriter writer) throws IOException { "upcalls", upcallStubs, "directUpcalls", directUpcallStubs); - writer.appendObjectStart().indent(); + writer.appendObjectStart(); boolean first = true; for (String sectionName : stubSets.keySet()) { Collection stubs = stubSets.get(sectionName); @@ -278,13 +278,13 @@ public void printJson(JsonWriter writer) throws IOException { if (!first) { writer.appendSeparator(); } - writer.newline().quote(sectionName).appendFieldSeparator().appendArrayStart().indent().newline(); + writer.quote(sectionName).appendFieldSeparator().appendArrayStart(); printStubs(writer, stubs); - writer.unindent().newline().appendArrayEnd(); + writer.appendArrayEnd(); first = false; } } - writer.unindent().newline().appendObjectEnd(); + writer.appendObjectEnd(); } private static void printStubs(JsonWriter writer, Collection stubs) throws IOException { @@ -293,7 +293,7 @@ private static void printStubs(JsonWriter writer, Collection parserOptions) { - if (combinedFileSchema) { - throw new IllegalArgumentException("Foreign configuration is only supported with the legacy metadata schema"); + if (!combinedFileSchema) { + throw new IllegalArgumentException("Foreign configuration is only supported with reachability-metadata.json"); } return new UnresolvedForeignConfigurationParser(parserOptions); } @@ -314,7 +314,7 @@ public boolean isEmpty() { @Override public boolean supportsCombinedFile() { - return false; + return true; } public interface Predicate { diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java index 74fff342b7d7..3e3b7d22e50e 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ConfigurationFiles.java @@ -134,16 +134,6 @@ public static final class Options { public static final HostedOptionKey ReachabilityMetadataResources = new HostedOptionKey<>( AccumulatingLocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @OptionMigrationMessage("Use a foreign-config.json in your META-INF/native-image// directory instead.")// - @Option(help = "Files describing stubs allowing foreign calls according to the schema at " + - "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/foreign-config-schema-v0.1.0.json", type = OptionType.User)// - @BundleMember(role = BundleMember.Role.Input)// - public static final HostedOptionKey ForeignConfigurationFiles = new HostedOptionKey<>( - AccumulatingLocatableMultiOptionValue.Paths.buildWithCommaDelimiter()); - @Option(help = "Resources describing stubs allowing foreign calls.", type = OptionType.User)// - public static final HostedOptionKey ForeignResources = new HostedOptionKey<>( - AccumulatingLocatableMultiOptionValue.Strings.buildWithCommaDelimiter()); - @OptionMigrationMessage("Use a predefined-classes-config.json in your META-INF/native-image// directory instead.")// @Option(help = "Files describing predefined classes that can be loaded at runtime according to the schema at " + "https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/predefined-classes-config-schema-v1.0.0.json", type = OptionType.User)// diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/metainf/MetaInfFileType.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/metainf/MetaInfFileType.java index 22bf910e516e..4498ff9c0d51 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/metainf/MetaInfFileType.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/metainf/MetaInfFileType.java @@ -33,7 +33,6 @@ public enum MetaInfFileType { Properties(null, NativeImageMetaInfWalker.nativeImagePropertiesFilename), ReachabilityMetadata(ConfigurationFiles.Options.ReachabilityMetadataResources, ConfigurationFile.REACHABILITY_METADATA.getFileName()), JniConfiguration(ConfigurationFiles.Options.JNIConfigurationResources, ConfigurationFile.JNI.getFileName()), - ForeignConfiguration(ConfigurationFiles.Options.ForeignResources, ConfigurationFile.FOREIGN.getFileName()), ReflectConfiguration(ConfigurationFiles.Options.ReflectionConfigurationResources, ConfigurationFile.REFLECTION.getFileName()), ResourceConfiguration(ConfigurationFiles.Options.ResourceConfigurationResources, ConfigurationFile.RESOURCES.getFileName()), ProxyConfiguration(ConfigurationFiles.Options.DynamicProxyConfigurationResources, ConfigurationFile.DYNAMIC_PROXY.getFileName()), diff --git a/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java b/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java index b13ba343e97b..a0cf776b2d7e 100644 --- a/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java +++ b/substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/ForeignFunctionsFeature.java @@ -66,7 +66,6 @@ import com.oracle.graal.pointsto.meta.AnalysisMethod; import com.oracle.graal.pointsto.meta.AnalysisUniverse; import com.oracle.svm.common.meta.MultiMethod; -import com.oracle.svm.configure.ConfigurationFile; import com.oracle.svm.configure.ConfigurationParser; import com.oracle.svm.core.ForeignSupport; import com.oracle.svm.core.JavaMemoryUtil; @@ -77,7 +76,6 @@ import com.oracle.svm.core.UnmanagedMemoryUtil; import com.oracle.svm.core.code.FactoryMethodHolder; import com.oracle.svm.core.code.FactoryThrowMethodHolder; -import com.oracle.svm.core.configure.ConfigurationFiles; import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature; import com.oracle.svm.core.feature.InternalFeature; import com.oracle.svm.core.foreign.AbiUtils; @@ -401,8 +399,7 @@ public void duringSetup(DuringSetupAccess a) { } ImageClassLoader imageClassLoader = access.getImageClassLoader(); - ConfigurationParserUtils.parseAndRegisterConfigurations(getConfigurationParser(imageClassLoader), imageClassLoader, "panama foreign", - ConfigurationFiles.Options.ForeignConfigurationFiles, ConfigurationFiles.Options.ForeignResources, ConfigurationFile.FOREIGN.getFileName()); + ConfigurationParserUtils.parseAndRegisterConfigurationsFromCombinedFile(getConfigurationParser(imageClassLoader), imageClassLoader, "panama foreign"); } private ConfigurationParser getConfigurationParser(ImageClassLoader imageClassLoader) {