From ac406f5c68dfebbdbc9c61d845c453c3a305a073 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 4 Apr 2018 21:37:42 -0700 Subject: [PATCH] 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 --- core/config.mk | 6 ++++++ target/board/generic/BoardConfig.mk | 4 +++- target/board/generic_arm64/BoardConfig.mk | 2 ++ target/board/generic_mips64/BoardConfig.mk | 2 ++ target/board/generic_x86/BoardConfig.mk | 2 ++ target/board/generic_x86_64/BoardConfig.mk | 2 ++ target/board/treble_common.mk | 2 ++ 7 files changed, 19 insertions(+), 1 deletion(-) diff --git a/core/config.mk b/core/config.mk index b3a204b589..b3f3d36626 100644 --- a/core/config.mk +++ b/core/config.mk @@ -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 # ############################################################### diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 70c78a8d9f..9bf3c8bed5 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -69,4 +69,6 @@ BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true -BOARD_VNDK_VERSION := current \ No newline at end of file +BOARD_VNDK_VERSION := current + +BUILD_BROKEN_DUP_RULES := false diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index be8ea3918a..dbdec9055c 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -101,3 +101,5 @@ TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true BOARD_VNDK_VERSION := current + +BUILD_BROKEN_DUP_RULES := false diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 2052d7bc75..fa4c355346 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -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 diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index f71e72b95d..3760cc4ec3 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -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 diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index a9c5142049..ec7a51e5de 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -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 diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index a8c9bc52bd..187022edb3 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -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