-
Notifications
You must be signed in to change notification settings - Fork 21
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
Enable native-image builds automatically #273
Comments
As just shared with @pivotal-david-osullivan, @scottfrederick and @wilkinsona, currently this file is not reliable way to detect that a native image build should be built for Boot apps because:
If you decide to move forward on this change, you should probably make sure:
I can understand the appeal of moving away from env variables to control the default trigger of a native build, but I am not convinced by this "trick" to create empty argfile to act as a trigger for Buildpacks. A |
Thanks @sdeleuze we'll have to wait and see how things play out and cautiously move forward. |
We could revisit this situation with Spring Boot 3.1 introducing |
@anthonydahanne @scottfrederick - Seems reasonable to me as a default. If you've enabled AOT processing, then we try to build a native image app. I do think we need an opt-out though, so we might still need |
We begin to have more use cases for AOT on the JVM, see https://twitter.com/sdeleuze/status/1650396526709993474, and we will likely explore and potentially refine this use case as part of Spring Framework 6.1, so I think I am not in favor of considering that the default for an app with AOT metadata should be native, even with an opt-out option. We IMO need a native specific signal. |
As discussed with @wilkinsona, if the behavior remains the same on Spring Boot side by setting The remaining lower concern I have is that if in the future we introduce a more first class support for AOT optimizations on the JVM, it would be tempting the use this AOT signal to set |
As described in spring-projects/spring-boot#35205, the manifest attribute that should be used to automatically enable native builds is |
great! so this entry will be in 3.1.0-RC2, right?! |
Yes, that's right. |
Hello all,
(you'll notice the new BP_MAVEN_ACTIVE_PROFILES env. variable that was very recently added)
Meanwhile, I invite you all to check out this running example demo'ing |
For 3, if there is no way to infer one |
* so that the user does not need to specify BP_NATIVE_IMAGE=true as well
…ative * so that the user does not need to specify BP_NATIVE_IMAGE=true as well
* checked with @pivotal-david-osullivan
* checked with @pivotal-david-osullivan
Describe the Enhancement
With #272 we are looking for a key file,
filepath.Join(n.ApplicationPath, "META-INF", "native-image", "argfile")
. If that file exists, we could assume that the user wants to have a native-image build and automatically enable native-image builds.Possible Solution
I'm not sure off hand if we can tie into the
BP_NATIVE_IMAGE
env variable or if we'd need to modify the buildplan. The native-image buildpack says that if you setnative-image-application
in the buildplan, it'll trigger a native-image build. One of these two options should work.Motivation
Right now a user has to manually set
BP_NATIVE_IMAGE=true
to trigger a native-image build. The presence of this file could be a trigger which we can use to infer user intent and automatically enable a native-image build (or at least flip the default from false to true, a user should still be able to opt-out by forcingBP_NATIVE_IMAGE=false
).The text was updated successfully, but these errors were encountered: