diff --git a/core/artifact_path_requirements.mk b/core/artifact_path_requirements.mk index 8b2d71bf0..ceaefa269 100644 --- a/core/artifact_path_requirements.mk +++ b/core/artifact_path_requirements.mk @@ -35,7 +35,9 @@ $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ $(makefile) produces files outside its artifact path requirement. \ Allowed paths are $(subst $(space),$(comma)$(space),$(addsuffix *,$(requirements)))) \ $(eval unused_allowed := $(filter-out $(files),$(allowed_patterns))) \ - $(call maybe-print-list-and-error,$(unused_allowed),$(makefile) includes redundant allowed entries in its artifact path requirement.) \ + $(if $(PRODUCTS.$(makefile).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED),, \ + $(call maybe-print-list-and-error,$(unused_allowed),$(makefile) includes redundant allowed entries in its artifact path requirement.) \ + ) \ $(eval ### Optionally verify that nothing else produces files inside this artifact path requirement.) \ $(eval extra_files := $(filter-out $(files) $(HOST_OUT)/%,$(product_target_FILES))) \ $(eval files_in_requirement := $(filter $(path_patterns),$(extra_files))) \ diff --git a/core/product.mk b/core/product.mk index 9aebc28d6..f47e6f20b 100644 --- a/core/product.mk +++ b/core/product.mk @@ -463,6 +463,13 @@ define require-artifacts-in-path $(sort $(ARTIFACT_PATH_REQUIREMENT_PRODUCTS) $(current_mk))) endef +# Like require-artifacts-in-path, but does not require all allow-list entries to +# have an effect. +define require-artifacts-in-path-relaxed + $(require-artifacts-in-path) \ + $(eval PRODUCTS.$(current_mk).ARTIFACT_PATH_REQUIREMENT_IS_RELAXED := true) +endef + # Makes including non-existent modules in PRODUCT_PACKAGES an error. # $(1): list of non-existent modules to allow. define enforce-product-packages-exist