New issue
Advanced search Search tips

Issue 882528 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Make it easier to see when AndroidManifext.xml contents are changing

Project Member Reported by agrieve@chromium.org, Sep 10

Issue description

Problem:
AndroidManifest.xml tweaks can be added to by any android_library (or prebuilt) vis manifest merging, but are not always desired by leaf APKs. This caused a real bug (bug 872977).

Solution:
Allow android_apk targets to specify an "expected" merged manifest file, and have the build fail if the contents don't match.

This will mean an expectations file will need to be updated when any library tweaks their manifest.

I'm thinking we should enable this for chrome_public_apk and system_webview_apk, but not for downstream targets (to avoid downstream breaking too often). Although, perhaps we could have downstream expectations "extend" upstream ones? Or allow multiple files to be listed as expectations?

Filed similar bug for Proguard rules: bug 882524
 
Golden copy is probably going to be too brittle. Eg if any inputs into the manifest depends on any gn flags, then flipping those gn flags will cause the build to fail.
Maybe we could do:

if (is_official_build) {
  expectations_files = [..]
}

is_official_build generally has very little wiggle room for GN args.
wouldn't that just make official builds be red all the time? :p ok, maybe not that bad, but adding more official-only failures isn't a good idea either, since it's already super hard to debug official-only failures now


I'm just pointing out problems with your proposals, but I don't actually have anything better to suggest than the status quo :/
The android-binary-size bot build official, so we'd have coverage for this on the CQ.
Is android-binary-size new on CQ? I don't see it on a CQ run from a few days ago.

I assume it's public so it won't actually match the official release bots. Maybe we put this check behind a new flag instead of is_official_build, and turn it on for only one bot (I guess doesn't matter which one now). Maybe also presubmit warning for updating the golden copy when the manifest is modified.
Click "Show Experimental Trybots" link on your CL and it should show up. We're just adding a couple more assertions to it before we switch it to non-experimental, but one of the goals for it is adding is_official_build coverage to CQ.

I'm still holding out hope that we won't see differences for debug vs release, but if it's the case that we do have to scope it down, I agree adding a presubmit is probably a good idea.
Labels: DevX
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2506a433b96350f943d72f684f9a05feba91aba4

commit 2506a433b96350f943d72f684f9a05feba91aba4
Author: Eric Stevenson <estevenson@chromium.org>
Date: Thu Jan 10 18:50:02 2019

Android: Support for tracking proguard flags changes.

This CL adds build rules to support verifying that certain generated
files haven't changed. Currently the merged proguard flags file is
supported.

This is only enforced when check_android_configuration = true, which
is only enabled on the android-binary-size trybot.

Follow-up CLs will include:
  * Support for "extending" expectation files (for use downstream)
  * Support for APK AndroidManifest.xml files

Bug: 882524, 882528
Change-Id: I421e1f24788a11343df5ad91cde7cc86ec15c801
Reviewed-on: https://chromium-review.googlesource.com/c/1394998
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621673}
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/build/android/gyp/proguard.py
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/build/android/gyp/proguard.pydeps
[add] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/build/android/gyp/util/diff_utils.py
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/build/config/android/config.gni
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/build/config/android/internal_rules.gni
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/build/config/android/rules.gni
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/chrome/android/BUILD.gn
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/chrome/android/OWNERS
[add] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/chrome/android/java/chrome_modern_public_apk.proguard_flags.expected
[add] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/chrome/android/java/chrome_public_apk.proguard_flags.expected
[add] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/chrome/android/java/monochrome_public_apk.proguard_flags.expected
[modify] https://crrev.com/2506a433b96350f943d72f684f9a05feba91aba4/tools/mb/mb_config.pyl

Labels: QuickFix

Sign in to add a comment