Skip to content

Conversation

@melix
Copy link
Collaborator

@melix melix commented Nov 25, 2022

The NativeImageOptions domain object is used in the DSL to configure both compile and runtime arguments for native images: the compile options are used to invoke native-image and build a binary, while the runtime args are used to pass extra arguments when executing the native image.

The full NativeImageOptions domain object was passed to the native image compilation task as a @Nested input, which meant in practice that if the runtime arguments changed, then we would rebuild the image although it isn't necessary.

This commit fixes the problem in a binary compatible way, by introducing a couple of interfaces: one for the compile options, the other for the runtime options. It makes the "options" internal on the compile task, and uses a delegated view of compile options for input snapshotting.

Fixes #371

@melix melix added the bug Something isn't working label Nov 25, 2022
@melix melix added this to the 0.9.19 milestone Nov 25, 2022
@melix melix requested review from dnestoro and sdeleuze November 25, 2022 08:15
@melix melix self-assigned this Nov 25, 2022
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 25, 2022
The `NativeImageOptions` domain object is used in the DSL to configure both compile and runtime arguments for native images: the compile options are used to invoke `native-image` and build a binary, while the runtime args are used to pass extra arguments when executing the native image. The full `NativeImageOptions` domain object was passed to the native image compilation task as a `@Nested` input, which meant in practice that if the _runtime_ arguments changed, then we would rebuild the image although it isn't necessary. This commit fixes the problem in a binary compatible way, by introducing a couple of interfaces: one for the compile options, the other for the runtime options. It makes the "options" internal on the compile task, and uses a delegated view of compile options for input snapshotting. Fixes #371
Copy link
Collaborator

@sdeleuze sdeleuze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reach me when merged to allow me to check snapshots does not introduce regression with Spring Boot 3.

With the removal of the Java 11 variant of GraalVM, we're not in capacity of testing this on pre-Gradle 7 since the spec won't let us specify that we need a GraalVM vendor.
@melix melix merged commit 9324f40 into master Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working OCA Verified All contributors have signed the Oracle Contributor Agreement.

2 participants