Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide API for further use of non-API methods in Quarkus #5013

Closed
zakkak opened this issue Sep 20, 2022 · 6 comments
Closed

Provide API for further use of non-API methods in Quarkus #5013

zakkak opened this issue Sep 20, 2022 · 6 comments

Comments

@zakkak
Copy link
Collaborator

zakkak commented Sep 20, 2022

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:

Relates to #4919

cc @olpaw

@olpaw
Copy link
Member

olpaw commented Sep 20, 2022

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 up org.graalvm.nativeimage.impl with --add-exports

cc @christianwimmer @vjovanov

@zakkak
Copy link
Collaborator Author

zakkak commented Mar 6, 2023

We have removed the invocations to org.graalvm.nativeimage.impl.RuntimeResourceSupport#ignoreResources in quarkusio/quarkus#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 #4684?

cc @christianwimmer

@christianwimmer
Copy link

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.

@zakkak zakkak closed this as completed Mar 14, 2023
@zakkak zakkak closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
@zakkak
Copy link
Collaborator Author

zakkak commented Feb 14, 2024

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 zakkak reopened this Feb 14, 2024
@christianwimmer
Copy link

christianwimmer commented Feb 14, 2024

@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.

@zakkak
Copy link
Collaborator Author

zakkak commented Feb 15, 2024

Oh, I didn't understand that. Thanks @christianwimmer, that seems to do the trick.

@zakkak zakkak closed this as completed Feb 15, 2024
zakkak added a commit to zakkak/quarkus that referenced this issue Feb 15, 2024
They both have the same result starting with 23.1. Runtime
initialization is public API while rerun is not, and will soon be
deprecated and at some point removed in future releases.

See oracle/graal#5013 (comment)
and oracle/graal#8323
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants