-
Notifications
You must be signed in to change notification settings - Fork 9
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
Allow --exclude-config arguments to be specified inside jar #196
Comments
@philwebb After discussing with @pivotal-david-osullivan this morning, we agreed that the easiest path from a Buildpacks perspective would be for Spring Boot to generate a On buildpack side, it would then just be about detecting this well-known file and pass it to the native image compiler via Would you be ok with that solution? |
@sdeleuze Yes, sound good to me. I've opened spring-projects/spring-boot#32738 and pushed a commit that should generate that file. We can't yet do an end-to-end test because we're waiting on an NBT release. |
As discussed today, end to end testing with Buildpacks should now be possible with NBT 0.9.15, even if we will need to release 0.9.16 to fix this regression that should impact only local NBT usage. |
Works as expected, this issue can now be closed. |
Describe the Enhancement
Currently
--exclude-config
arguments can be specified inBP_NATIVE_IMAGE_BUILD_ARGUMENTS
in order to pass a list of configurations that should be excluded during native image creation. Spring Boot is working on native image support and would like a way to define--exclude-config
arguments inside the JAR file. This will allow a jar file to describe completely how it should be converted into a native image.Possible Solution
During creation of the JAR file, Spring Boot can add a
META-INF/native-image/exclude-config-args
file containing the--exclude-config
arguments that it would like added. For example:The file would consist of one line per
--exclude-config
argument. The example above would result in the following being passed to thenative-image
command line:Motivation
Graal provides a reachability-metadata repository that contains JSON files that allow third-party libraries to work. Spring Boot is looking to use this repository to bundle appropriate JSON files from the repository into the fat jar that it creates. We hope to achieve this by configuring the native-build-tools plugin so that it directly packages the appropriate JSON files. An enhancement request for native-build-tools is currently under review.
For most libraries, adding the metadata will be enough to create a fully functioning native image, however, some need to use "overrides". The override flag allows the metadata repository to override hints that are packaged inside the library jar itself. It can be used when a library ships incorrect meta-data that later needs to be corrected.
When the native-build-tools plugin is being used directly to create the image it is able to construct appropriate
--exclude-config
arguments. For example, this is how the Maven plugin generates the arguments. We need an equivalent option for use with buildpacks and unfortunately we can use--exclude-config
in theArgs
property underMETA-INF/native-image/native-image.properties
.For more background and discussion please see spring-projects/spring-boot#31782
The text was updated successfully, but these errors were encountered: