RUM-14050: Fix R8 missing class error caused by dd-javac-plugin annotations#3601
Conversation
When dd-java-agent is attached to the Gradle daemon (introduced in #3583 via setup-gradle), it instruments classes at load time for source code profiling, injecting references to datadog.compiler.annotations. SourceLines and datadog.compiler.annotations.SourcePath into bytecode. R8 then sees these references but can't find the annotation class definitions in the build classpath, causing a hard failure in every publish-benchmark-synthetics (and potentially other synthetics) CI job since that PR merged. Add -dontwarn rules for datadog.compiler.annotations.** in the benchmark and kotlin sample proguard files so R8 ignores these agent-injected annotation references. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3601 +/- ##
===========================================
+ Coverage 72.80% 72.86% +0.05%
===========================================
Files 975 975
Lines 35276 35269 -7
Branches 5972 5974 +2
===========================================
+ Hits 25682 25696 +14
+ Misses 7929 7908 -21
Partials 1665 1665 🚀 New features to boost your workflow:
|
|
@abrooksv Me too, thanks for sharing! Actually Claude thought this was coming from just |
Looks like it originates here, I don't see a way to turn it off from a cursory browse of the surrounding code Edit: Looks like https://github.com/DataDog/dd-trace-java/blob/fe1861dda15d491193539b32cc4a4b18c1513e8a/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java#L21 disables that part CI visibility plugin, but keeps coverage reporting |
What does this PR do?
Adds
-dontwarn datadog.compiler.annotations.**to the ProGuard rules forsample/benchmarkandsample/kotlin.Why
PR #3583 introduced a
setup-gradleCI snippet that appendsdd-java-agenttoorg.gradle.jvmargsacross all jobs — intentionally, to get build telemetry. The side effect is thatdd-java-agentbundles and activates dd-javac-plugin, a Java compiler plugin that annotates every compiled class with@SourcePathand@SourceLinesfor source code integration. The annotation class definitions live in a companiondd-javac-plugin-clientJAR that is not added to the build classpath.So R8 sees those annotation references in the compiled classes, can't find the backing class definitions, and fails hard on
minifyReleaseWithR8.This has been breaking
test-pyramid:publish-benchmark-synthetics(and likely the other synthetics publish jobs) on every pipeline since #3583 merged.Fix
-dontwarnis the standard R8 fix here. These are compiler-injected annotations used only for profiling source correlation — they have no relevance to the output APK and are safe to ignore.Review checklist