Allow setting some build_broken out of boardconfig
Some build broken flags are for cross-cutting features rather than
board-specific. In order to support these without requiring broad
changes across many board configs, these can be set in a buildspec.mk
files.
Test: set build_broken flags in environment, get expected fail
Test: set build_broken flags in buildspec, get expected success
Change-Id: I8a74c30575f6bf40e46281ca5f37f3cfed526ec5
diff --git a/core/config.mk b/core/config.mk
index 5de5504..0c6653a 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -342,6 +342,23 @@
JAVA_TMPDIR_ARG :=
endif
+# These build broken variables are intended to be set in a buildspec file,
+# while other build broken flags are expected to be set in a board config.
+# These are build broken variables that are expected to apply across board
+# configs, generally for cross-cutting features.
+
+# Build broken variables that should be treated as booleans
+_build_broken_bool_vars := \
+ BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES \
+
+# Build broken variables that should be treated as lists
+_build_broken_list_vars := \
+ BUILD_BROKEN_PLUGIN_VALIDATION \
+
+_build_broken_var_names := $(_build_broken_bool_vars)
+_build_broken_var_names += $(_build_broken_list_vars)
+$(foreach v,$(_build_broken_var_names),$(eval $(v) :=))
+
# ###############################################################
# Include sub-configuration files
# ###############################################################
@@ -371,6 +388,13 @@
# are specific to the user's build configuration.
include $(BUILD_SYSTEM)/envsetup.mk
+
+$(foreach var,$(_build_broken_bool_vars), \
+ $(if $(filter-out true false,$($(var))), \
+ $(error Valid values of $(var) are "true", "false", and "". Not "$($(var))")))
+
+.KATI_READONLY := $(_build_broken_var_names)
+
# Returns true if it is a low memory device, otherwise it returns false.
define is-low-mem-device
$(if $(findstring ro.config.low_ram=true,$(PRODUCT_PROPERTY_OVERRIDES)),true,\