getsentry / sentry-android-gradle-plugin

Gradle plugin for Sentry Android. Upload proguard, debug files, and more.

Home Page:https://docs.sentry.io/platforms/android/gradle/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SentryCliValueSource frequently invalidates the configuration cache

PhilGlass opened this issue · comments

Gradle Version

8.6.0

AGP Version

8.3.0

Code Minifier/Optimizer

R8

Version

4.2.0

Sentry SDK Version

7.5.0

Steps to Reproduce

  1. ./gradlew -stop && ./gradlew help --info | grep 'cli extracted'
  2. ./gradlew -stop && ./gradlew help --info | grep 'cli extracted'

You'll see logs like this:

[sentry] cli extracted from resources into: /var/folders/9w/s6zpth1x60z9gkx7h07fkjkw0000gn/T/.sentry-cli12100801394406373218.exe

where the CLI is extracted to a new temporary file each time, changing the value computed by SentryCliValueSource and invalidating the configuration cache. This is because the path is effectively random and only stored in memory.

Expected Result

The CLI is extracted once to a known location and reused from then on.

Actual Result

Each time a new daemon is used the CLI is extracted to a new temporary file and the configuration cache is invalidated.

hi @PhilGlass thanks for reporting, we were aware of this problem (#651) but it did not seem significant as the cli path is preserved within a single daemon. But we'll take a look on how to improve that , since this is still not ideal 👍

closing this, as it's already tracked by #651

The issues are different - #651 is about tasks never being up-to-date, this one is about invalidating the configuration cache (particularly problematic on CI, because you get a fresh daemon for every run). But the underlying cause is the same, so hopefully the solution will fix both problems. 🙏