Skip to content
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

Fix compile task out of date when runtime args change #372

Merged
merged 2 commits into from Nov 28, 2022
Merged

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 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.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using runtimeArgs causes the _compile_ task to be out of date
2 participants