Repository navigation
Conversation
…ion cache checkNativeImageNoAwt's onlyIf and runNativeImageAgent's doFirst read the application (app.windowing, app.mainClass, app.args), so the configuration cache stored the application with them, and with it the Kotlin target and its source set. On Gradle 8.13 storing failed with "Cannot run Project.afterEvaluate(Action) when the project is already evaluated" (found by Gemstone, which runs both with --no-configuration-cache); on 8.13 and 9.3.1 the problem report names DefaultSourceSet. The check task takes the windowing as an input and its spec reads the task; the agent reads the main class and arguments through providers. NativeImageConfigurationCacheTest dry-runs both tasks twice in a native image project with the configuration cache on, and checks the entry is stored and then reused. It failed on Gradle 8.13 and 9.3.1 before and passes on both. Fixes #74
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #74.
Problem. Two native-image tasks read the application object at execution time, so the configuration cache had to store the whole application with them, including the Kotlin target and its source set:
checkNativeImageNoAwt'sonlyIfreadsapp.windowing.runNativeImageAgent'sdoFirstreadsapp.mainClassandapp.args.On Gradle 8.13, Gemstone (LogitAI/Gemstone JetBrains#255, plugin 1.11.1-ext.3) got
Cannot run Project.afterEvaluate(Action) when the project is already evaluatedand now runs both tasks with--no-configuration-cache. On 8.13 and 9.3.1 the configuration cache problem report namesDefaultSourceSetfor both tasks.Change.
CheckNativeImageNoAwtTaskgains an@Input windowingproperty. The plugin sets it from the application, andonlyIfreads the task's own property.runNativeImageAgentreads the main class and arguments throughproject.provider { }. The configuration cache stores their values, not the application.Test, red first.
NativeImageConfigurationCacheTestis new in the integration tests. Its test projectapplication/nativeImageConfigurationCachehasoutput = ApplicationOutput.NativeImage.packageNativeImage --dry-runandrunNativeImageAgent --dry-runtwice each, with the configuration cache on. A dry run stores the task graph like a real run, so no GraalVM is needed.Configuration cache entry stored.on the first run andReusing configuration cache.on the second.Local runs (macOS arm64).
-Pcompose.tests.gradle.versions='8.13, 9.3.1'The existing
NativeImage*unit tests pass too.On 8.13, my
--testsfilter wasn't passed to that task, so the whole integration suite ran there. 79 of its other tests failed in that unfiltered run. This PR doesn't touch them, and 8.13 isn't in the plugin's testedcompose.tests.gradle.versions(9.3.1, 9.5.0).🤖 Generated with Claude Code