bazelbuild / rules_android

Android rules for Bazel
Apache License 2.0
179 stars 44 forks source link

Bug: ProguardMapping is not queryable nor deterministically generated #194

Open EdbertChan opened 9 months ago

EdbertChan commented 9 months ago

There is a bug in rules_android where the proguard_mapping file may not be reproduced. The root cause is that the proguard mapping file is not being explicitly declared as the output of the implicit target.

Reproduction steps:

1) Build a Bazel binary that enables proguard mapping, enables disk, and remote cache 2) Run bazel clean --expunge 3) Rebuild the Bazel binary. 4) Observe the proguard mapping is not found at bazel-out/xplat-fastbuild/bin//_RESOURCES_DO_NOT_USE_proguard.map

Furthermore, there is no way to actually query this file. This is problematic because we will need to upload the obfuscated mapping when debugging/deobfuscating builds.

bazel cquery //:_RESOURCES_DO_NOT_USE --output files

ahumesky commented 9 months ago

is proguard_generate_mapping enabled on the android_binary? https://bazel.build/reference/be/android#android_binary.proguard_generate_mapping

the proguard mapping file should be an implicit output of the binary, available as targetname_proguard.map

https://bazel.build/reference/be/android#android_binary_implicit_outputs