Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompatDexBuilder and Desugar write excessive amounts of info and warning messages to the console #17647

Closed
Bencodes opened this issue Mar 2, 2023 · 1 comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team type: bug

Comments

@Bencodes
Copy link
Contributor

Bencodes commented Mar 2, 2023

Description of the bug:

The R8 based dexing and desugaring actions are writing an excessive amount of info and warning messages to the console that are distracting and aren't really actionable.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

The easiest way to reproduce these errors is to build an Android binary that depends on maven dependencies that do not have a complete classpath.

You will often see messages that look like:

(12:25:26) INFO: From Desugaring external/maven/_aar/com_braintreepayments_api_venmo/classes_and_libs_merged.jar for Android:
Warning in bazel-out/android-arm64-v8a-dbg/bin/external/maven/_aar/androidx_work_work_runtime/classes_and_libs_merged.jar:androidx/work/impl/utils/futures/AbstractFuture.class:
(11:50:37) INFO: From Dexing external/maven/_dx/org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm/processed_kotlinx-coroutines-core-jvm-1.6.4.jar_desugared.jar with applicable dexopts []:
Info: Stripped invalid locals information from 1 method.
Info in bazel-out/android-arm64-v8a-dbg/bin/external/maven/_dx/org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm/processed_kotlinx-coroutines-core-jvm-1.6.4.jar_desugared.jar:kotlinx/coroutines/flow/FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$10.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$10.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation)
  Attempt to define local of type long as element$iv:java.lang.Object
Info: Some warnings are typically a sign of using an outdated Java toolchain. To fix, recompile the source with an updated toolchain.
Info: Stripped invalid locals information from 1 method.
Info in bazel-out/android-arm64-v8a-dbg/bin/external/maven/_dx/org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm/processed_kotlinx-coroutines-core-jvm-1.6.4.jar_desugared.jar:kotlinx/coroutines/flow/FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$9.class:
Methods with invalid locals information:
  java.lang.Object kotlinx.coroutines.flow.FlowKt__BuildersKt$asFlow$$inlined$unsafeFlow$9.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation)
  Attempt to define local of type int as element$iv:java.lang.Object
Info: Some warnings are typically a sign of using an outdated Java toolchain. To fix, recompile the source with an updated toolchain.

Which operating system are you running Bazel on?

Mac OS

What is the output of bazel info release?

HEAD

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@sgowroji sgowroji added type: bug team-Android Issues for Android team untriaged labels Mar 2, 2023
copybara-service bot pushed a commit that referenced this issue Aug 28, 2023
This pull request provides a custom `DiagnosticsHandler` implementation that redirects info and warning messages to the original `System#err` stream so that the noisy D8 messages are written to the worker log file instead of directly to the console.

In addition this PR also removes the custom system stream redirection, and instead uses the baked in `WorkerIO` implementation that automatically wraps the system stream for us that was added here #14201.

#17647

Closes #17648.

PiperOrigin-RevId: 560600558
Change-Id: I9d2d162b62fe5dfd00e8614ba73caf1cac5f02d7
@ahumesky ahumesky added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jan 23, 2024
@ahumesky
Copy link
Contributor

#17648 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-Android Issues for Android team type: bug
Projects
None yet
Development

No branches or pull requests

4 participants
@Bencodes @ahumesky @sgowroji and others