Replies: 6 comments 10 replies
-
I'm a bit unclear what the request is. From a technical standpoint, native-image must know about a resource at buildtime to be able to package it into the binary for runtime. Otherwise, it's up to the program to read the data from an external source (e.g. file, database). In previous versions of native-image, it was possible to manually specify sets of resources using a regex. I think that went away with the https://www.graalvm.org/latest/reference-manual/native-image/metadata/ also mentions |
Beta Was this translation helpful? Give feedback.
-
@zakkak I am also considering to relax the current setting. I feel we have two major culprits here:
I am not in favor of adding a special flag to make things work (for debugging it is OK), as this moves Native Image away from the Java semantics. My plan is to experiment with these three approaches in the next 2 months and then we can decide what is easiest to support and use. @zakkak what are your thoughts? |
Beta Was this translation helpful? Give feedback.
-
Regarding bloat, I find that the biggest problem here are not the application classes, but the JDK classes. In a simple
Yes it would include all of these types to be available for
We do, exactly, just the default exception for
When you boil it down, this is a workaround for a lack of Maybe we could throw This way libraries would be able to handle this and we don't need extra JSON. In the future if a
|
Beta Was this translation helpful? Give feedback.
-
We could make a flag for this, but I would leave it as experimental for the time the third-party libraries don't adopt the new semantics. |
Beta Was this translation helpful? Give feedback.
-
Have you considered branching the logic of the original code on the We created an enum around the possible values for convenience. |
Beta Was this translation helpful? Give feedback.
-
In general, to make an informed decision it would be good to give examples of how many entries relative to all metadata entries need to be added for the project to work. If the number of entries is relatively small compared to the size of the project (e.g. <1-2% of all entries), I feel the benefits of strict semantics outweigh the cost of maintaining the extra entries (especially because the missing entries are pretty easy to find). |
Beta Was this translation helpful? Give feedback.
-
Hello,
At the moment,
--exact-reachability-metadata
requires all resources being accessed at run-time to be registered at build-time. This is a great way to detect if the code is trying to access some resource that has been mistakenly left out and is not available at run-time. However, it also results in errors when using libraries that try to load resources based on "trial and error", e.g. to find configuration files under different folders like the user's home directory, the current directory, etc.Having to register all the potential resources seems too tedious. I wonder if an option to exclude specific code-paths, classes, or packages from the
exact-reachability-metadata
checks would make sense. E.g., for resources we could allow unregistered accesses from packageio.smallrye.config
.cc @vjovanov
Beta Was this translation helpful? Give feedback.
All reactions