Skip to content

Commit

Permalink
DPKG caching final review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalimuthu-Velappan committed Mar 11, 2020
1 parent a96e519 commit f7c6630
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Makefile.cache
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@


# Common files and FLAGS
# Run the 'touch nocommon' command in the base directory to exclude the common files from caching
SONIC_COMMON_FILES_LIST := $(if $(wildcard nocommon),, .platform slave.mk rules/functions Makefile.cache)
# Run the 'touch cache.skip.common' command in the base directory to exclude the common files from caching
SONIC_COMMON_FILES_LIST := $(if $(wildcard cache.skip.common),, .platform slave.mk rules/functions Makefile.cache)
SONIC_COMMON_FLAGS_LIST := $(CONFIGURED_PLATFORM) \
$(SONIC_DPKG_CACHE_SOURCE) $(SONIC_DEBUGGING_ON) \
$(SONIC_PROFILING_ON) $(SONIC_SANITIZER_ON)
Expand Down Expand Up @@ -128,7 +128,7 @@ define MOD_LOCK
chmod 777 $(2)/$(1)_$(3).lock;
fi
$(eval $(1)_lock_fd=$(subst ~,_,$(subst -,_,$(subst +,_,$(subst .,_,$(1))))))
exec {$($(1)_lock_fd)}<"$(2)/$(1)_$(3).lock";
exec {$($(1)_lock_fd)}<>"$(2)/$(1)_$(3).lock";
if ! flock -x -w $(4) "$${$($(1)_lock_fd)}" ; then
echo "ERROR: Lock timeout trying to access $(2)/$(1)_$(3).lock";
exit 1;
Expand Down Expand Up @@ -218,7 +218,7 @@ define LOAD_FROM_CACHE

# Form the cache file name
$(eval $(1)_MOD_CACHE_FILE := $(1)-$($(1)_DEP_MOD_SHA)-$($(1)_MOD_HASH).tgz)
$(if $(MDEBUG), $(info MODE_CACHE_FILE := $($(1)_MOD_CACHE_FILE)))
$(if $(MDEBUG), $(info $(1)_MODE_CACHE_FILE := $($(1)_MOD_CACHE_FILE)))

# Retrive and log files list that are modified for the target.
$(call GET_MODIFIED_FILES,$(1))
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/libsaithrift-dev.dep
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/libsaithrift-dev.mk platform/broadcom/libsaithrift-dev.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen
$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files)))))
$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " )))))

$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA
$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
Expand Down
11 changes: 11 additions & 0 deletions rules/docker-sonic-mgmt-spytest.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

DPATH := $($(DOCKER_MGMT_SPYTEST)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-sonic-mgmt-spytest.mk rules/docker-sonic-mgmt-spytest.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_MGMT_SPYTEST)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_MGMT_SPYTEST)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_MGMT_SPYTEST)_DEP_FILES := $(DEP_FILES)

$(eval $(call add_dbg_docker,$(DOCKER_MGMT_SPYTEST),$(DOCKER_MGMT_FRAMEWORK_DBG)))
12 changes: 12 additions & 0 deletions rules/sonic-thermalctld.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

SPATH := $($(SONIC_THERMALCTLD)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-thermalctld.mk rules/sonic-thermalctld.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))

$(SONIC_THERMALCTLD)_CACHE_MODE := GIT_CONTENT_SHA
$(SONIC_THERMALCTLD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(SONIC_THERMALCTLD)_DEP_FILES := $(DEP_FILES)
$(SONIC_THERMALCTLD)_SMDEP_FILES := $(SMDEP_FILES)
$(SONIC_THERMALCTLD)_SMDEP_PATHS := $(SPATH)

0 comments on commit f7c6630

Please sign in to comment.