From 8970425a75dabe8b8685bba8800dff81ac970d2f Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 9 May 2022 12:05:57 -0700 Subject: [PATCH] Fix calculation of $(1)_DEP_PKGS_SHA in Makefile.cache (#10764) In Makefile.cache, for $(1)_DEP_PKGS_SHA, the intention is to include the DEP_MOD_SHA and MOD_HASH of each of the current package's dependencies. However, there's a level of dereferencing missing; instead of grabbing the value of $(dfile)_DEP_MOD_SHA, it is literally using the variable name $(dfile)_DEP_MOD_SHA. This means that the value of this variable will not change when some dependency changes. The impact of this is in transitive dependencies. For a specific example, if there is some change in sairedis, then sairedis will be rebuilt (because there's a change within that component), and swss will be rebuilt (because it's a direct dependency), but docker-swss-layer-buster will not get rebuilt, because only the direct dependencies are effectively being checked, and those aren't changing. Signed-off-by: Saikrishna Arcot --- Makefile.cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.cache b/Makefile.cache index d092112983..8ac02b73b3 100644 --- a/Makefile.cache +++ b/Makefile.cache @@ -183,7 +183,7 @@ define GET_MOD_DEP_SHA $(if $($(1)_DEP_FILES_MISSING), $(warning "[ DPKG ] Dependecy file(s) are not found for $(1) : $($(1)_DEP_FILES_MISSING))) # Include package dependencies hash values into package hash calculation - $(eval $(1)_DEP_PKGS_SHA := $(foreach dfile,$(1)_MOD_DEP_PKGS,$(dfile)_DEP_MOD_SHA $(dfile)_MOD_HASH)) + $(eval $(1)_DEP_PKGS_SHA := $(foreach dfile,$($(1)_MOD_DEP_PKGS),$($(dfile)_DEP_MOD_SHA) $($(dfile)_MOD_HASH))) $(eval $(1)_DEP_MOD_SHA := $(shell bash -c "git hash-object $($(1)_DEP_MOD_SHA_FILES) && echo $($(1)_DEP_PKGS_SHA)" \ | sha1sum | awk '{print substr($$1,0,23);}'))