-
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
Fail the build if CDS_TRAINING_JAVA_TOOL_OPTIONS is set with BP_SPRING_AOT_ENABLED=true #494
Conversation
+1 for this change as the flag gives a false sense that AOT and CDS can be combined with Buildpacks, which is not true for some use cases as demonstrated in the issue linked above (this is a by design problem, not something we can fix easily with current Spring Boot and Buildpacks capabilities). I also add here that this change should not block anybody since people not impacted by the issue described above can still manually set |
…G_AOT_ENABLED=true * those 2 options are not compatible, see spring-projects/spring-boot#41348
f468c60
to
d2369b9
Compare
Hello @dmikusa , @pivotal-david-osullivan @sdeleuze 👋 Please read the updated title and description and changeset for this PR. Then, know that you can test it out with this: anthonydahanne/petclinic-efficient-container@62d6873 If you do, you will experience this, because it's now forbidden to have CDS_TRAINING_JAVA_TOOL_OPTIONS set when BP_SPRING_AOT_ENABLED is true:
Please let us know what you think! Thanks! |
Thanks @anthonydahanne, I think this is a great tradeoff as it still allows to use the AOT flag, even potentially with CDS but not with the problematic custom training run Java options. That brings clarity, the options supported are the one we are able to fully support, and the documentation provides pointers for users wanting to dig deeper. All good from my POV 👍🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All sounds good to me
* it could break apps that had AOT'ed some migration library like flyway during build, which would need some extra code (java) to not automatically use them at runtime (and training run...) see: spring-projects/spring-boot#41348* after confirmation we won't ever re introduce AOT support along with CDS in Spring Boot buildpack, we'll deprecate the featureIf the application is AOT instrumented (presence of
META-INF/native-image
folder) ANDBP_SPRING_AOT_ENABLED
is set totrue
ANDCDS_TRAINING_JAVA_TOOL_OPTIONS
is set* fail the build with "build failed because of invalid user configuration" - the reason being is that the AOT classes used during training run won't be compatible with a different set of
JAVA_TOOL_OPTIONS
at runtime* the Spring team explains this issue in detail here: spring-projects/spring-boot#41348
Checklist