Skip to content

[R8] Orphan proguard_mappings_output_file #546

Description

@vadymsavchenko-lyft

With the recent change to the android_binary rule's default config (commit)

proguard_mappings_output_file is no longer written to the baseline bazel-bin and now lands in the transitioned ST-<hash> output root, so it is no longer under the directory bazel info bazel-bin reports. More generally the mapping is an output of no target: it can't be requested by label, never enters a runfiles tree, and isn't fetched under --remote_download_toplevel.

The solution is to declare proguard_mappings_output_file as implicit_outputs of the ProviderInfo, copying the D8 approach. This doesn't change where the file is written; it makes it a default output, so consumers in the top-level configuration can collect it.

diff --git a/rules/android_binary/r8.bzl b/rules/android_binary/r8.bzl
index 4c4510114..c921d6d98 100644
--- a/rules/android_binary/r8.bzl
+++ b/rules/android_binary/r8.bzl
@@ -194,6 +194,7 @@ def process_r8(ctx, validation_ctx, jvm_ctx, packaged_resources_ctx, build_info_
         value = struct(
             final_classes_dex_zip = final_classes_dex_zip,
             dex_info = android_dex_info,
+            implicit_outputs = [proguard_mappings_output_file],
             providers = [
                 android_dex_info,
                 AndroidPreDexJarInfo(pre_dex_jar = deploy_jar),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions