Skip to content

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

Open
runningcode wants to merge 2 commits into
mainfrom
no/config-cache-cli-path
Open

fix(config-cache): Resolve CLI path via ValueSource task input (GRADLE-70)#1264
runningcode wants to merge 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
### Fixes

- Compose tracing no longer adds the Sentry modifier multiple times for chained modifiers (e.g. `Modifier.fillMaxSize().padding()`) on Kotlin 2.2 and newer ([#1253](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1253))
- Resolve the sentry-cli path as a task input instead of memoizing it in a static field, fixing stale-path build failures when switching branches with the configuration cache enabled ([#1264](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1264))

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.

need to rebase and move this to Unreleased again, since there has been a new version released in the meantime

Comment thread CHANGELOG.md Outdated
### Fixes

- Compose tracing no longer adds the Sentry modifier multiple times for chained modifiers (e.g. `Modifier.fillMaxSize().padding()`) on Kotlin 2.2 and newer ([#1253](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1253))
- Resolve the sentry-cli path as a task input instead of memoizing it in a static field, fixing stale-path build failures when switching branches with the configuration cache enabled ([#1264](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1264))

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.

Suggested change
- Resolve the sentry-cli path as a task input instead of memoizing it in a static field, fixing stale-path build failures when switching branches with the configuration cache enabled ([#1264](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1264))
- Resolve the sentry-cli path as a task input instead of memoizing it in a static field, fixing stale-path build failures when switching branches with the configuration cache enabled ([#1264](https://github.com/getsentry/sentry-android-gradle-plugin/pull/1264))
- This fixed the issue where sentry-cli could not be found (`A problem occurred starting process 'command ../sentry-cliXXX.exe'`)

maybe add this for better SEO and discoverability?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, added it

@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 <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/config-cache-cli-path branch from 889add0 to ca5f687 Compare June 8, 2026 15:40
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@runningcode runningcode force-pushed the no/config-cache-cli-path branch from ca5f687 to eb3267a Compare June 8, 2026 15:41
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