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

Non-deterministic native image JSON hints invalidate Gradle build cache #31852

Closed
mmoayyed opened this issue Dec 15, 2023 · 2 comments
Closed
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Milestone

Comments

@mmoayyed
Copy link
Contributor

mmoayyed commented Dec 15, 2023

Affects: 6.1.2 (though probably 6.1.x and 6.0.x as well)

When the framework begins to write and produce JSON configuration files for native images, the hints that are collected are written to output files non-deterministically. Testing with Gradle 8.5, if I run the relevant tasks to run the AOT generation process with Spring Boot 3.2.0, the Gradle build scan (when comparing task inputs and outputs, etc) shows that subsequent builds had to run yet again because the output file is different:

image

In fact, the file content is exactly the same but the order of elements is different. Here is an example where you'd see elements moved around slightly between build A and build B:

image

It appears that hints need to be sorted somehow, or otherwise be written to the file in a consistent deterministic way so the structure of the file remains the same.

@bclozel bclozel added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Dec 15, 2023
@bclozel bclozel added this to the 6.1.x milestone Dec 15, 2023
@snicoll snicoll self-assigned this Dec 15, 2023
@snicoll snicoll added type: bug A general bug and removed type: enhancement A general enhancement labels Dec 15, 2023
@snicoll snicoll changed the title Non-deterministic (unordered) native image JSON hints invalidate Gradle build cache Non-deterministic native image JSON hints invalidate Gradle build cache Dec 15, 2023
@snicoll snicoll modified the milestones: 6.1.x, 6.1.3 Dec 18, 2023
@snicoll
Copy link
Member

snicoll commented Dec 18, 2023

@mmoayyed Thanks for the report. Please give 6.1.3-SNAPSHOT a try when you get a chance.

@mmoayyed
Copy link
Contributor Author

Chiming in here quickly to confirm that 6.1.3-SNAPSHOT removes this issue. Thank you @snicoll!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants