Skip to content

fix(config-cache): Resolve CLI path via ValueSource task input (GRADLE-70)#1264

Merged
runningcode merged 2 commits into
mainfrom
no/config-cache-cli-path
Jun 9, 2026
Merged

fix(config-cache): Resolve CLI path via ValueSource task input (GRADLE-70)#1264
runningcode merged 2 commits into
mainfrom
no/config-cache-cli-path

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

Summary

The sentry-cli path was memoized in a @Volatile static field on SentryCliProvider. That field survives across builds within the Gradle daemon and is not invalidated when switching branches, so a stale path pointing at a sentry-cli temp file extracted under a previous checkout could be reused — producing Could not start '…/.sentry-cliXXXX.exe' … No such file or directory failures when the configuration cache is enabled.

This removes the static memoization and stops threading the cli path (cliExecutable: Provider<String>) through the configure() call chain into every task. Each SentryCliExecTask now resolves the path itself in asSentryCliExec() via the existing cliExecutableProvider() ValueSource (which Gradle correctly invalidates on branch switches), and wires its own buildDirectory task input.

This is one of two PRs splitting the config-cache work; the companion PR #1263 (GRADLE-82) makes the telemetry org lookup config-cache friendly. This PR keeps the cliExecutable parameter on configure() because telemetry still needs it on main; whichever PR lands second will drop that now-unused parameter in a small rebase.

Fixes GRADLE-70

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Jun 4, 2026

Copy link
Copy Markdown

GRADLE-70

@runningcode
runningcode force-pushed the no/config-cache-cli-path branch from 0ae0479 to 889add0 Compare June 4, 2026 12:43
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated

@romtsn romtsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great impact!

…E-70)

The sentry-cli path was memoized in a static field on SentryCliProvider.
That field survives across builds in the Gradle daemon and is not
invalidated when switching branches, so a stale path pointing at a
sentry-cli temp file from a previous checkout could be reused, causing
"No such file or directory" failures when configuration caching is on.

Remove the static memoization and stop threading the cli path through
the configure() call chain. Each SentryCliExecTask now resolves the path
itself in asSentryCliExec() via the existing cliExecutableProvider()
ValueSource, which is properly invalidated on branch switches, and wires
its own buildDirectory input.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@runningcode
runningcode force-pushed the no/config-cache-cli-path branch from 889add0 to ca5f687 Compare June 8, 2026 15:40
@runningcode
runningcode force-pushed the no/config-cache-cli-path branch from ca5f687 to eb3267a Compare June 8, 2026 15:41
@runningcode
runningcode merged commit 04a10bf into main Jun 9, 2026
23 checks passed
@runningcode
runningcode deleted the no/config-cache-cli-path branch June 9, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants