Skip to content

RUM-14050: Fix R8 missing class error caused by dd-javac-plugin annotations#3601

Merged
kikoveiga merged 1 commit into
developfrom
kikoveiga/fix-r8-missing-dd-agent-annotations
Jul 2, 2026
Merged

RUM-14050: Fix R8 missing class error caused by dd-javac-plugin annotations#3601
kikoveiga merged 1 commit into
developfrom
kikoveiga/fix-r8-missing-dd-agent-annotations

Conversation

@kikoveiga

@kikoveiga kikoveiga commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds -dontwarn datadog.compiler.annotations.** to the ProGuard rules for sample/benchmark and sample/kotlin.

Why

PR #3583 introduced a setup-gradle CI snippet that appends dd-java-agent to org.gradle.jvmargs across all jobs — intentionally, to get build telemetry. The side effect is that dd-java-agent bundles and activates dd-javac-plugin, a Java compiler plugin that annotates every compiled class with @SourcePath and @SourceLines for source code integration. The annotation class definitions live in a companion dd-javac-plugin-client JAR 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

-dontwarn is 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

  • No functional change to the app
  • Both sample apps that go through R8 release builds are covered

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]>
@kikoveiga
kikoveiga requested review from a team as code owners July 2, 2026 17:58

@abrooksv abrooksv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@kikoveiga kikoveiga changed the title RUM-14050: Fix R8 missing class error caused by dd-java-agent annotations RUM-14050: Fix R8 missing class error caused by dd-javac-plugin annotations Jul 2, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.86%. Comparing base (3533bee) to head (d361e7e).
⚠️ Report is 5 commits behind head on develop.

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              

see 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kikoveiga

Copy link
Copy Markdown
Contributor Author

TIL about https://github.com/DataDog/dd-javac-plugin

@abrooksv Me too, thanks for sharing! Actually Claude thought this was coming from just dd-java-agent, but it's actually this agent activating dd-javac-plugin 😅

@abrooksv

abrooksv commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

TIL about https://github.com/DataDog/dd-javac-plugin

@abrooksv Me too, thanks for sharing! Actually Claude thought this was coming from just dd-java-agent, but it's actually this agent activating dd-javac-plugin 😅

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

@kikoveiga
kikoveiga merged commit 9622211 into develop Jul 2, 2026
27 checks passed
@kikoveiga
kikoveiga deleted the kikoveiga/fix-r8-missing-dd-agent-annotations branch July 2, 2026 19:31
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