From 01475b41fbac6755a269d13e5ba9261acdecab1d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 23 Mar 2023 20:37:34 -0700 Subject: [PATCH] Don't read test mapping list in Make Reading the test mapping list in Make causes Kati to regenerate any time a TEST_MAPPING file is added or removed. Pass the file to the rule and read it during ninja instead. Bug: 274987114 Test: m test_mapping Change-Id: I68a76646d70c85b2cb992e4da52a7854acd370b9 --- core/tasks/test_mapping.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/tasks/test_mapping.mk b/core/tasks/test_mapping.mk index 0b0c93ca0a..eb2a585880 100644 --- a/core/tasks/test_mapping.mk +++ b/core/tasks/test_mapping.mk @@ -21,17 +21,17 @@ intermediates := $(call intermediates-dir-for,PACKAGING,test_mapping) test_mappings_zip := $(intermediates)/test_mappings.zip test_mapping_list := $(OUT_DIR)/.module_paths/TEST_MAPPING.list -test_mappings := $(file <$(test_mapping_list)) -$(test_mappings_zip) : PRIVATE_test_mappings := $(subst $(newline),\n,$(test_mappings)) $(test_mappings_zip) : PRIVATE_all_disabled_presubmit_tests := $(ALL_DISABLED_PRESUBMIT_TESTS) +$(test_mappings_zip) : PRIVATE_test_mapping_list := $(test_mapping_list) -$(test_mappings_zip) : $(test_mappings) $(SOONG_ZIP) +$(test_mappings_zip) : .KATI_DEPFILE := $(test_mappings_zip).d +$(test_mappings_zip) : $(test_mapping_list) $(SOONG_ZIP) @echo "Building artifact to include TEST_MAPPING files and tests to skip in presubmit check." rm -rf $@ $(dir $@)/disabled-presubmit-tests echo $(sort $(PRIVATE_all_disabled_presubmit_tests)) | tr " " "\n" > $(dir $@)/disabled-presubmit-tests - echo -e "$(PRIVATE_test_mappings)" > $@.list - $(SOONG_ZIP) -o $@ -C . -l $@.list -C $(dir $@) -f $(dir $@)/disabled-presubmit-tests - rm -f $@.list $(dir $@)/disabled-presubmit-tests + $(SOONG_ZIP) -o $@ -C . -l $(PRIVATE_test_mapping_list) -C $(dir $@) -f $(dir $@)/disabled-presubmit-tests + echo "$@ : " $$(cat $(PRIVATE_test_mapping_list)) > $@.d + rm -f $(dir $@)/disabled-presubmit-tests test_mapping : $(test_mappings_zip)