diff --git a/Changes.md b/Changes.md index fc6701d7e5..6836528762 100644 --- a/Changes.md +++ b/Changes.md @@ -10,8 +10,9 @@ If you need to extend the build system via a plugin, please reach out to the build team via email android-building@googlegroups.com (external) for any questions, or see [go/soong](http://go/soong) (internal). -To omit the validation, `BUILD_BROKEN_PLUGIN_VALIDATION` expects a list of -plugins to omit from the validation. +To omit the validation, `BUILD_BROKEN_PLUGIN_VALIDATION` expects a +space-separated list of plugins to omit from the validation. This must be set +within a product configuration .mk file, board config .mk file, or buildspec.mk. ## Python 2 to 3 migration diff --git a/core/board_config.mk b/core/board_config.mk index 856fde245b..c3a6864afa 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -171,7 +171,6 @@ _board_strip_list += ODM_MANIFEST_SKUS _build_broken_var_list := \ - BUILD_BROKEN_PLUGIN_VALIDATION \ BUILD_BROKEN_CLANG_PROPERTY \ BUILD_BROKEN_CLANG_ASFLAGS \ BUILD_BROKEN_CLANG_CFLAGS \ @@ -186,7 +185,6 @@ _build_broken_var_list := \ BUILD_BROKEN_PREBUILT_ELF_FILES \ BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \ BUILD_BROKEN_USES_NETWORK \ - BUILD_BROKEN_USES_SOONG_PYTHON2_MODULES \ BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE \ BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES \ diff --git a/core/config.mk b/core/config.mk index 5de5504103..0c6653a122 100644 --- a/core/config.mk +++ b/core/config.mk @@ -342,6 +342,23 @@ else 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 @@ endif # 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,\