Sebastian Schuberth
07/10/2025, 10:02 AM./gradlew :cli:run --args="--version"
for the first time, I get output like
> Task :cli:run
62.2.0
BUILD SUCCESSFUL in 47s
358 actionable tasks: 349 executed, 9 up-to-date
Configuration cache entry stored.
So the run
task is being executed. However, doing the same directly afterwards again, I get
Parallel Configuration Cache is an incubating feature.
Reusing configuration cache.
BUILD SUCCESSFUL in 1s
349 actionable tasks: 349 up-to-date
Configuration cache entry reused.
So the run
task is not executed. I that's that's probably due to the build cache, but passing --no-build-cache
makes no difference. However, passing --no-configuration-cache
does make a difference, and I wonder why:
❯ ./gradlew :cli:run --args="--version" --no-configuration-cache
Type-safe project accessors is an incubating feature.
> Configure project :
Building ORT version 62.2.0.
BUILD SUCCESSFUL in 4s
358 actionable tasks: 1 executed, 357 up-to-date
I though the configuration cache just caches how tasks are configured, but not their output. Does anyone have a clue what's going on here? IMO, the run
task should actually never be cached.Vampire
07/10/2025, 10:06 AMVampire
07/10/2025, 10:06 AMVampire
07/10/2025, 10:06 AM--info
(or if not enough --debug
) say about that run task?Vampire
07/10/2025, 10:07 AMrun
task by default should not be cacheable unless you configured it to beSebastian Schuberth
07/10/2025, 10:08 AMEven in your last snippet I do not see the run task executed, just a lifecycle output from your build logic.You're right, I myself confused
> Configure project :
Building ORT version 62.2.0.
lifecycle output with
> Task :cli:run
62.2.0
task output. Sorry, I've been staring at this for too long already...Vampire
07/10/2025, 10:09 AMSebastian Schuberth
07/10/2025, 10:16 AM--no-build-cache
nor --no-configuration-cache
makes the task run again.Vampire
07/10/2025, 10:17 AMSebastian Schuberth
07/10/2025, 10:17 AMSebastian Schuberth
07/10/2025, 10:20 AMVampire
07/10/2025, 10:22 AMVampire
07/10/2025, 10:22 AMVampire
07/10/2025, 10:23 AMSebastian Schuberth
07/10/2025, 10:24 AMSo you declared inputs and outputs for that taskI don't think I did: https://github.com/sschuberth/stan/blob/main/cli/build.gradle.kts
Vampire
07/10/2025, 11:06 AM:cli:run
task has 55 file inputs 32 property inputs and 1 file output.
The inputs should be normal and if there were only inputs the task would not be up-to-dateable.
But as there are inputs and outputs, it is.
The output is stan/cli/build/native/agent-output/run
.Vampire
07/10/2025, 11:06 AMVampire
07/10/2025, 11:12 AMVampire
07/10/2025, 11:13 AMorg.graalvm.buildtools.gradle.NativeImagePlugin#configureAgent
adds a jvm argument provider that has an @OutputDirectory
property that is set to that directoryVampire
07/10/2025, 11:16 AMtasks.run.configure {
doNotTrackState("The task is not supposed to be UP-TO-DATE.")
}
you should get the state you intend.Vampire
07/10/2025, 11:20 AMtasksToInstrumentPredicate
on the agent
field of the graalvmNative
extension like
graalvmNative {
agent {
tasksToInstrumentPredicate = Predicate { name != "run" }
}
}
Sebastian Schuberth
07/10/2025, 12:23 PMSebastian Schuberth
07/10/2025, 12:42 PMVampire
07/10/2025, 12:47 PMrun
task could well be up-to-date or even cacheable, for example if it processes some inputs to some outputs and rerunning would just produce the same result, it would be fully expected that the task is up-to-date and cacheable.
If then the GraalVM adds an output to the task, the task should be out-of-date if it changed or vanished and also cache that output alongside if the task is cacheable.
If it would not add the output to the task, that would actually be a bug and a more serious one.Sebastian Schuberth
07/10/2025, 12:55 PMif it processes some inputs to some outputs and rerunning would just produce the same result, it would be fully expected that the task is up-to-date and cacheable.True, but that's something only the application itself can say, not a generic plugin that can be applied to any application, which could be interactive and do different things on each run based on user input (or similar environment changes).