Skip to content

Fix R8 failures due to missing SourceLines annotation in 3.12.0#3641

Closed
abrooksv wants to merge 32 commits into
release/3.12.0from
abrooks/disable-javac-injection
Closed

Fix R8 failures due to missing SourceLines annotation in 3.12.0#3641
abrooksv wants to merge 32 commits into
release/3.12.0from
abrooks/disable-javac-injection

Conversation

@abrooksv

@abrooksv abrooksv commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

In CI, we monitor tests and our build via dd-trace-java. The issue is that for java compile tasks, they inject a javac plugin that adds in a SourceLines and SourcePath annotation. The issue is that this injected annotation is not in our runtime dependencies, so R8 will fail due to the missing annotation

Ramification for us is that our tests in the Test Optimization product may have their line numbers not as accurate due to the standard method line number table only tracks executable lines, so it won't include comments or method declaration in the UI.

Verification

Ran locally with org.gradle.jvmargs=-Xmx4096m -javaagent:/tmp/dd-tracer-repro/dd-java-agent.jar=dd.env=ci,dd.trace.enabled=false,dd.jmx.fetch.enabled=false,dd.trace.debug=true,dd.trace.startup.logs=true

> Task :dd-sdk-android-internal:compileReleaseKotlin

> Task :dd-sdk-android-internal:compileReleaseJavaWithJavac
Dependency verification has been disabled.
Dependency verification has been disabled.
Dependency verification has been disabled.
DatadogCompilerPlugin initialized

> Task :dd-sdk-android-internal:apiBuild

--- 
mkdir -p /tmp/core-aar-check && unzip -p /tmp/dd-sdk-android-3120-repro/dd-sdk-android-core/build/outputs/aar/dd-sdk-android-core-release.aar classes.jar > /tmp/core-aar-check/classes.jar && javap -v -p -classpath /tmp/core-aar-check/classes.jar com.datadog.android.BuildConfig | grep -i "SourceLines\|SourcePath" -A2
  #48 = Utf8               Ldatadog/compiler/annotations/SourceLines;
  #49 = Utf8               start
  #50 = Integer            6
--
  #53 = Utf8               Ldatadog/compiler/annotations/SourcePath;
  #54 = Utf8               value
  #55 = Utf8               /private/tmp/dd-sdk-android-3120-repro/dd-sdk-android-core/build/generated/source/buildConfig/release/com/datadog/android/BuildConfig.java
--
    datadog.compiler.annotations.SourceLines(
      start=6
      end=18
--
    datadog.compiler.annotations.SourcePath(
      value="/private/tmp/dd-sdk-android-3120-repro/dd-sdk-android-core/build/generated/source/buildConfig/release/com/datadog/android/BuildConfig.java"
    )

With proposed fix locally: org.gradle.jvmargs=-Xmx4096m -javaagent:/tmp/dd-tracer-repro/dd-java-agent.jar=dd.env=ci,dd.trace.enabled=false,dd.jmx.fetch.enabled=false,dd.civisibility.compiler.plugin.auto.configuration.enabled=false

mkdir -p /tmp/core-aar-check2 && unzip -p /tmp/dd-sdk-android-3120-repro/dd-sdk-android-core/build/outputs/aar/dd-sdk-android-core-release.aar classes.jar > /tmp/core-aar-check2/classes.jar && (javap -v -p -classpath /tmp/core-aar-check2/classes.jar com.datadog.android.BuildConfig | grep -i "SourceLines\|SourcePath" || echo "not found")

not found

Motivation

Fixes #3639

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

abrooksv and others added 30 commits July 13, 2026 11:56
This is the first step to migrating off the shared static analysis pipeline
* Consolidate Detekt configurations together
* Use Detekt Gradle plugin to execute Detekt
Merge release/3.12.0 into develop

Co-authored-by: ambushwork <[email protected]>
RUM-17238: Use Gradle plugin to run detekt
abrooksv added 2 commits July 15, 2026 10:58
In CI, we monitor tests and our build via dd-trace-java. The issue is that for java compile tasks, they inject a javac plugin that adds in a SourceLines and SourcePath annotation. The issue is that this injected annotation is not in our runtime dependencies, so R8 will fail due to the missing annotation
@abrooksv abrooksv changed the title Abrooks/disable javac injection Fix R8 failures due to missing SourceLines annotation in 3.12.0 Jul 15, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.25%. Comparing base (430f377) to head (22a09c9).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3641      +/-   ##
===========================================
- Coverage    73.32%   73.25%   -0.06%     
===========================================
  Files          995      995              
  Lines        36273    36282       +9     
  Branches      6126     6126              
===========================================
- Hits         26594    26578      -16     
- Misses        7977     8004      +27     
+ Partials      1702     1700       -2     

see 41 files with indirect coverage changes

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

0xnm
0xnm previously approved these changes Jul 15, 2026
@abrooksv
abrooksv marked this pull request as ready for review July 15, 2026 18:50
@abrooksv
abrooksv requested review from a team as code owners July 15, 2026 18:50
ambushwork
ambushwork previously approved these changes Jul 15, 2026
@abrooksv
abrooksv changed the base branch from develop to release/3.12.0 July 15, 2026 20:02
@abrooksv
abrooksv dismissed stale reviews from ambushwork and 0xnm July 15, 2026 20:02

The base branch was changed.

@abrooksv
abrooksv requested a review from a team as a code owner July 15, 2026 20:02
@abrooksv
abrooksv requested review from pavlokhrebto and typotter and removed request for a team July 15, 2026 20:02
@abrooksv abrooksv closed this Jul 15, 2026
@abrooksv
abrooksv deleted the abrooks/disable-javac-injection branch July 15, 2026 20:25
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.

Missing classes causing R8 to fail on release builds

4 participants