From 7306d684113bd8dea8221433ee3ad74a78162c48 Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Tue, 31 May 2022 11:15:44 +0300 Subject: [PATCH] [build][asan] make dpkg cache asan-aware (#10750) Currently, the build with ASAN_ENABLE=y reuses the packages built with ASAN_ENABLE=n (and vice versa). To address this issue, ASAN_ENABLE is added to DEP_FLAGS for asan-enabled packages (docker-syncd-mlnx, syncd, docker-orchagent, swss). - Why I did it To make dpkg cache use/rebuild the packages for ASAN_ENABLE=y/n. - How I did it Added ASAN_ENABLE to the DEP_FLAGS for asan-enabled packages. - How to verify it Built with ASAN_ENABLE=y/n and checked the .flags .log files. Signed-off-by: Yakiv Huryk --- platform/mellanox/docker-syncd-mlnx.dep | 2 +- rules/docker-orchagent.dep | 2 +- rules/swss.dep | 2 +- rules/syncd.dep | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/mellanox/docker-syncd-mlnx.dep b/platform/mellanox/docker-syncd-mlnx.dep index 659b09cec8..8f2ab723dd 100644 --- a/platform/mellanox/docker-syncd-mlnx.dep +++ b/platform/mellanox/docker-syncd-mlnx.dep @@ -6,7 +6,7 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(DPATH)) $(DOCKER_SYNCD_BASE)_CACHE_MODE := GIT_CONTENT_SHA -$(DOCKER_SYNCD_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SYNCD_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) $(DOCKER_SYNCD_BASE)_DEP_FILES := $(DEP_FILES) $(eval $(call add_dbg_docker,$(DOCKER_SYNCD_BASE),$(DOCKER_SYNCD_BASE_DBG))) diff --git a/rules/docker-orchagent.dep b/rules/docker-orchagent.dep index 7aff4d0d9f..a5fc67a65a 100644 --- a/rules/docker-orchagent.dep +++ b/rules/docker-orchagent.dep @@ -5,7 +5,7 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(DPATH)) $(DOCKER_ORCHAGENT)_CACHE_MODE := GIT_CONTENT_SHA -$(DOCKER_ORCHAGENT)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_ORCHAGENT)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) $(DOCKER_ORCHAGENT)_DEP_FILES := $(DEP_FILES) $(eval $(call add_dbg_docker,$(DOCKER_ORCHAGENT),$(DOCKER_ORCHAGENT_DBG))) diff --git a/rules/swss.dep b/rules/swss.dep index e57a9e7a63..784d2ddd95 100644 --- a/rules/swss.dep +++ b/rules/swss.dep @@ -5,7 +5,7 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) $(SWSS)_CACHE_MODE := GIT_CONTENT_SHA -$(SWSS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SWSS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) $(SWSS)_DEP_FILES := $(DEP_FILES) $(SWSS)_SMDEP_FILES := $(SMDEP_FILES) $(SWSS)_SMDEP_PATHS := $(SPATH) diff --git a/rules/syncd.dep b/rules/syncd.dep index d9f40a8a02..fe0706ff97 100644 --- a/rules/syncd.dep +++ b/rules/syncd.dep @@ -12,7 +12,7 @@ $(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(a $(SYNCD)_CACHE_MODE := GIT_CONTENT_SHA -$(SYNCD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SYNCD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ENABLE_ASAN) $(SYNCD)_DEP_FILES := $(DEP_FILES) $(SYNCD)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) $(SYNCD)_SMDEP_PATHS := $(SMDEP_PATHS)