From 8c3d79dd37120bb5c2c3e6b7d70680645dbfc791 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Wed, 18 Jul 2018 14:15:54 +0100 Subject: [PATCH] Dump artifacts offending path reqs into a file Dump offending artifacts into a file that can be inspected after a build regardless of whether path requirements are enforced or not. This makes it easier to track progress for products not yet ready to enable enforcement. Bug: 80410283 Test: lunch mainline_arm64; m out/target/product/generic_arm64/offending_artifacts.txt Change-Id: Id05fbf256edf3689ab0b9851b34658d6d84939b2 --- core/main.mk | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/main.mk b/core/main.mk index 7d27ef3f7..a6db3712a 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1001,17 +1001,21 @@ $(foreach makefile,$(ARTIFACT_PATH_REQUIREMENT_PRODUCTS),\ $(eval unused_whitelist := $(filter-out $(files),$(whitelist_patterns))) \ $(call maybe-print-list-and-error,$(unused_whitelist),$(makefile) includes redundant whitelist 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_FILES))) \ + $(eval files_in_requirement := $(filter $(path_patterns),$(extra_files))) \ + $(eval all_offending_files += $(files_in_requirement)) \ + $(eval whitelist := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST)) \ + $(eval whitelist_patterns := $(call resolve-product-relative-paths,$(whitelist))) \ + $(eval offending_files := $(filter-out $(whitelist_patterns),$(files_in_requirement))) \ $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS),\ - $(eval extra_files := $(filter-out $(files) $(HOST_OUT)/%,$(product_FILES))) \ - $(eval whitelist := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST)) \ - $(eval whitelist_patterns := $(call resolve-product-relative-paths,$(whitelist))) \ - $(eval files_in_requirement := $(filter $(path_patterns),$(extra_files))) \ - $(eval offending_files := $(filter-out $(whitelist_patterns),$(files_in_requirement))) \ $(call maybe-print-list-and-error,$(offending_files),$(INTERNAL_PRODUCT) produces files inside $(makefile)s artifact path requirement.) \ $(eval unused_whitelist := $(filter-out $(extra_files),$(whitelist_patterns))) \ $(call maybe-print-list-and-error,$(unused_whitelist),$(INTERNAL_PRODUCT) includes redundant artifact path requirement whitelist entries.) \ ) \ ) +$(PRODUCT_OUT)/offending_artifacts.txt: + rm -f $@ + $(foreach f,$(sort $(all_offending_files)),echo $(f) >> $@;) ifeq (0,1) $(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)