Disable verify_uses_libraries check if dexpreopt is globally disabled.

Without dexpreopt the check is not necessary, and although it is good to
have, it is difficult to maintain on non-linux build platforms where
dexpreopt is generally disabled (the check may fail due to various
unrelated reasons, such as a failure to get manifest from an APK).

Bug: 181570790
Bug: 132357300

Test: Emulate the failed no-dexpreopt build in b/181570790:
  - modify verify_uses_libraries to make a subcommand fail
  - check that the build with dexpreopt fails:
    $ lunch cf_x86_64_phone-userdebug && m
  - set `WITH_DEXPREOPT := false` in make/core/board_config.mk
  - check that the build without dexpreopt succeeds (allow boot image
    and system servert dexproept to avoid unrelated build failures, this
    does not affect verify_uses_libraries):
    $ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY=true \
      lunch cf_x86_64_phone-userdebug && m

Change-Id: Ic456be4e3047a60415a21fae658077165fb03165
This commit is contained in:
Ulya Trafimovich 2021-03-04 12:07:44 +00:00
parent 2344aacd02
commit 6f06f9ea7a
1 changed files with 9 additions and 0 deletions

View File

@ -102,6 +102,15 @@ ifndef LOCAL_ENFORCE_USES_LIBRARIES
endif
endif
# Disable verify_uses_libraries check if dexpreopt is globally disabled.
# Without dexpreopt the check is not necessary, and although it is good to have,
# it is difficult to maintain on non-linux build platforms where dexpreopt is
# generally disabled (the check may fail due to various unrelated reasons, such
# as a failure to get manifest from an APK).
ifneq ($(WITH_DEXPREOPT),true)
LOCAL_ENFORCE_USES_LIBRARIES :=
endif
my_enforced_uses_libraries :=
ifdef LOCAL_ENFORCE_USES_LIBRARIES
my_enforced_uses_libraries := $(intermediates.COMMON)/enforce_uses_libraries.status