Allow boards to turn overriding commands into an error

Many boards have warnings like this, saying that we defined a build
rule, but later something else came in and overrode it with something
else:

art/build/Android.gtest.mk:677: warning: overriding commands for target `test-art-target-gtest-cmdline_parser_test'
art/build/Android.gtest.mk:674: warning: ignoring old commands for target `test-art-target-gtest-cmdline_parser_test'

Beyond the obvious problem of replacing the rule with something else,
target-specific variables can be combined as well, leading to some very
strange problems.

Since so many boards still have problems like this, but we don't
currently have any global problems, add a flag so that we can mark
boards as not broken. This should prevent regressions while we clean up
the individual problems.

Once the non-broken devices number significantly more than the broken
devices, we'll switch this default. And once they're all cleaned up this
variable will become obsolete, and these warnings will always be errors.

Bug: 77611511
Test: lunch aosp_arm-eng; m nothing
Test: lunch aosp_marlin-eng; m nothing
Test: build_test on all downstream branches
Change-Id: I43b645658f468c23a5b9ebcfcd9d4516537db540
This commit is contained in:
Dan Willemsen 2018-04-04 21:37:42 -07:00
parent e543e409d2
commit ac406f5c68
7 changed files with 19 additions and 1 deletions

View File

@ -189,6 +189,12 @@ else
JAVA_TMPDIR_ARG :=
endif
# ###############################################################
# Broken build defaults
# ###############################################################
# Assume that all boards have duplicate rules right now.
BUILD_BROKEN_DUP_RULES := true
# ###############################################################
# Include sub-configuration files
# ###############################################################

View File

@ -69,4 +69,6 @@ BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BOARD_VNDK_VERSION := current
BOARD_VNDK_VERSION := current
BUILD_BROKEN_DUP_RULES := false

View File

@ -101,3 +101,5 @@ TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BOARD_VNDK_VERSION := current
BUILD_BROKEN_DUP_RULES := false

View File

@ -91,3 +91,5 @@ DEX_PREOPT_DEFAULT := nostripping
# Enable A/B update
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BUILD_BROKEN_DUP_RULES := false

View File

@ -63,6 +63,8 @@ BOARD_SEPOLICY_DIRS += \
BOARD_VNDK_VERSION := current
BUILD_BROKEN_DUP_RULES := false
# Enable A/B update
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

View File

@ -65,3 +65,5 @@ BOARD_VNDK_VERSION := current
# Enable A/B update
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
BUILD_BROKEN_DUP_RULES := false

View File

@ -58,3 +58,5 @@ ifeq ($(BOARD_AVB_ENABLE),true)
$(error BOARD_AVB_ENABLE cannot be set for Treble GSI)
endif
BOARD_BUILD_DISABLED_VBMETAIMAGE := true
BUILD_BROKEN_DUP_RULES := false