From 206971459d4c2dbbc050a289ed121a79e13a881c Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 6 Sep 2023 18:10:43 -0700 Subject: [PATCH] Fix $(PROGUARD_DICT_ZIP) builds Previously, when building the proguard dict zip, we got a lot of warnings like these, and the files were always rebuilt: ``` [ 39% 9/23] Copy symbols with mapping: out/target/common/obj/APPS/HTMLViewer_intermediates/proguard_dictionary ninja: Missing `restat`? An output file is older than the most recent input: output: out/target/common/obj/APPS/HTMLViewer_intermediates/proguard_dictionary.textproto input: out/soong/.intermediates/packages/apps/HTMLViewer/HTMLViewer/android_common/e10894d3da5db41239526c9048962355/proguard_dictionary ``` For some reason kati wasn't adding `restat=true` on these ninja rules. Adding $(4) to KATI_RESTAT fixes it for some reason. Test: m dist repeatedly doesn't give the restat warnings Change-Id: Ie02526b3ab127f42bdc2db350d2dc468e7888fe2 --- core/definitions.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/definitions.mk b/core/definitions.mk index 909357ce2b..b6b0d69ed2 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -3422,6 +3422,10 @@ endef # $(2): path in symbols directory # $(3): file type (elf or r8) # $(4): path in the mappings directory +# +# Regarding the restats at the end: I think you should only need to use KATI_RESTAT on $(2), but +# there appears to be a bug in kati where it was not adding restat=true in the ninja file unless we +# also added 4 to KATI_RESTAT. define _copy-symbols-file-with-mapping $(2): .KATI_IMPLICIT_OUTPUTS := $(4) $(2): $(SYMBOLS_MAP) @@ -3430,6 +3434,7 @@ $(2): $(1) $$(copy-file-to-target) $(SYMBOLS_MAP) -$(strip $(3)) $(2) -write_if_changed $(4) .KATI_RESTAT: $(2) +.KATI_RESTAT: $(4) endef