Skip to content

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

Closed
@mmoayyed

Description

@mmoayyed

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.

Metadata

Metadata

Assignees

Labels

theme: aotAn issue related to Ahead-of-time processingtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions