-
Notifications
You must be signed in to change notification settings - Fork 168
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
Support GraalVM native images #599
Comments
Hi @artembilan, I have no idea what is necessary to support GraalVM native images. Regards, |
OK. Will look into that in a couple weeks. |
Fixes rometools#599 There is a lot of reflection in the project which probably has to be reworked this or other way eventually. But for now it is enough to have a proper reflection info exposed for GraalVM when it builds a native image for our application. Used a `native-image-agent` to take a required native image config from the running sample application. More info in GraalVM docs: https://www.graalvm.org/22.0/reference-manual/native-image/Agent/. Works only if GraalVM is used to run the application, of course. In general it is probably better to rework all the content of the `rome.properties` into a Java ServiceLoader API. There is also too much `clone()` operations with reflection in the project: perhaps better to look into something like deep copy approach. So, the fix is like this: * Add `META-INF/native-image/romtools/resource-config.json` to make all the properties from the project available for native image * Add `META-INF/native-image/romtools/reflect-config.json` for classes in the project used for reflection Mostly content of these files is generated by the mentioned above GraalVM agent * Remove `LOG` property from the `CopyFromHelper` since it is used only to log an error where we re-throw it immediately anyway. This was an attempt to see if `initialize-at-build-time` for some classes helps us somehow since there is a lot of `static` initialization, but turns out we still do that `clone()` with reflection, so pointless.
Hi @artembilan, thanks for your PR, I'll review it asap. Some Offtopic: how do you maintain different (major) versions @ Spring (regarding to Git)? I have no experience with that but I want to support Rome 2.x for a year while implementing massive backwards-incompatible changes in parallel for Version 3 (#637). Regards, |
Hey, @PatrickGotthard ! Well, our practice is like this:
To make yourself more familiar with Git I'd recommend to take a look into this book: https://git-scm.com/book/en/v2 |
See more info here: spring-projects/spring-integration#3900.
It looks like
reflect-config.json
must contain entry for thecom.rometools.rome.feed.module.DCModuleImpl
class and all entries listed in thecom/rometools/rome/rome.properties
.Including this
rome.properties
as an entry in theresource-config.json
.It might be also great to look into initialization some static properties at build time. Like
SyndFeedImpl.CONVERTERS
.The text was updated successfully, but these errors were encountered: