graal
graal copied to clipboard
Provide API for further use of non-API methods in Quarkus
Describe the issue
Quarkus still depends on some Classes/Methods under the package org.graalvm.nativeimage.impl
which do not appear to have obvious alternatives at the moment. These are:
-
org.graalvm.nativeimage.impl.RuntimeResourceSupport#ignoreResources
-
org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport#rerunInitialization
Relates to https://github.com/oracle/graal/issues/4919
cc @olpaw
Regarding
We do not want to make that public API as it violates composability of the resource inclusion in native-image configuration metadata. There a several options to cope with that:
- Get rid of depending on
ignoreResources
by not over-including resources in the first place. I.e. at build time, iterate/walk the resources that you want to have included and register them individually. - If you want to cancel out resource inclusion done by some other place (resource-config.json in some library that you use) , use
--exclude-config <jar-with-bad-config>
to get rid of its resource inclusion. - keep using
RuntimeResourceSupport#ignoreResources
by opening uporg.graalvm.nativeimage.impl
with--add-exports
cc @christianwimmer @vjovanov
We have removed the invocations to org.graalvm.nativeimage.impl.RuntimeResourceSupport#ignoreResources
in https://github.com/quarkusio/quarkus/pull/31185
Is there any feedback regarding org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport#rerunInitialization
? Are there any plans to make this public as well, or not due to https://github.com/oracle/graal/pull/4684?
cc @christianwimmer
rerunInitialization
is certainly not going to be API, because as you correctly note https://github.com/oracle/graal/pull/4684 should make every class have the semantic of "rerun" without needing explicit registration.
rerunInitialization
is certainly not going to be API, because as you correctly note #4684 should make every class have the semantic of "rerun" without needing explicit registration.
@christianwimmer apparently that's not true for classes explicitly set for build time initialization (the default for all classes in Quarkus). Such classes still require explicit registration for runtime initialization. As a result Quarkus still depends on org.graalvm.nativeimage.impl.RuntimeClassInitializationSupport#rerunInitialization
@zakkak with the new class initialization policy, RuntimeClassInitializationSupport#rerunInitialization
is the same as initializeAtRunTime
.
With https://github.com/oracle/graal/pull/8323/files#diff-3c452e61cb9ddfbab251a9aa0a134b4c0be47a0ec39020eee896e97a3ef5e2f1R55 rerunInitialization
will be deprecated and hard-code to initializeAtRunTime
.
Oh, I didn't understand that. Thanks @christianwimmer, that seems to do the trick.