From ed714e0f2431055aeed2532360b8b6b98b8c2943 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Thu, 22 Sep 2022 12:42:24 -0700 Subject: [PATCH] Use shell sort command When using builtin sort() function, make will detect changes in the find sub-expression, and re-parse the whole makefile. Even though file list after soring is identical. This is bad for incremental builds, as everytime a python file is modified, the order files that gets returned by find changes, resulting in long build time. Test: th Change-Id: I8cc347b4473a2b241f2f10e016e5968477c482f3 --- core/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index b95d2ad256..a802a4ce2d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5065,8 +5065,8 @@ INTERNAL_OTATOOLS_PACKAGE_FILES += \ endif INTERNAL_OTATOOLS_RELEASETOOLS := \ - $(sort $(shell find build/make/tools/releasetools -name "*.pyc" -prune -o \ - \( -type f -o -type l \) -print)) + $(shell find build/make/tools/releasetools -name "*.pyc" -prune -o \ + \( -type f -o -type l \) -print | sort) BUILT_OTATOOLS_PACKAGE := $(PRODUCT_OUT)/otatools.zip $(BUILT_OTATOOLS_PACKAGE): PRIVATE_ZIP_ROOT := $(call intermediates-dir-for,PACKAGING,otatools)/otatools