From d9a1ec74d55eb11bd61023cfe25183032164f74a Mon Sep 17 00:00:00 2001 From: Nikolai Merinov Date: Fri, 14 Nov 2025 13:31:16 +0200 Subject: [PATCH] BuildSystem: Use cached list of Makefile.append's during package processing The code to find OVERLAY_MAKEFILE_APPENDS for each package took about 0.3 seconds which can create a big overhad during "./scripts/feeds update" processing, where OpenWrt process each package that exists in all feeds, not only packages targeted for installation. To reduce processing time we will re-use the "$(TMP_DIR)/info/.files-packageinfo-$(SCAN_COOKIE)" file that created on each run of "make" in OpenWrt root directory and, after the 1ff542795469713241354ac9c8e6267bc45f9101 commit, contains list of all relevant Makefile.append files. In cases when this file missed, the plain search implementation would be used to get list of Makefile.append's. References: PPW-1162 Signed-off-by: Nikolai Merinov --- include/overlay-feed/package.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/overlay-feed/package.mk b/include/overlay-feed/package.mk index 8b1478609c..f8870d8d7d 100644 --- a/include/overlay-feed/package.mk +++ b/include/overlay-feed/package.mk @@ -12,7 +12,11 @@ define Overlay/Prepare/Patch endef Hooks/Prepare/Post += Overlay/Prepare/Patch +ifneq ($(wildcard $(TMP_DIR)/info/.files-packageinfo-$(SCAN_COOKIE)),) +$(call rewrite,OVERLAY_MAKEFILE_APPENDS,$(shell grep '^[$$].*/$(PKG_DIR_NAME)/Makefile.append' $(TMP_DIR)/info/.files-packageinfo-$(SCAN_COOKIE))) +else OVERLAY_MAKEFILE_APPENDS := $(foreach feed,$(shell $(TOPDIR)/scripts/feeds list -n 2>/dev/null),$(shell find -L $(TOPDIR)/feeds/$(feed)/ -path '*/$(PKG_DIR_NAME)/Makefile.append' | sort)) +endif PKG_FILE_DEPENDS += $(foreach mk,$(OVERLAY_MAKEFILE_APPENDS), $(dir $(mk))) define Build/IncludeOverlay