Skip to content

Commit

Permalink
[build]: DPKG caching fix for evaluation bugs (#4425)
Browse files Browse the repository at this point in the history
Added DPKG support for ICCPD package
Added warning support for missing dependency files that causes the incorrect SHA generation.
  • Loading branch information
Kalimuthu-Velappan authored Apr 20, 2020
1 parent 87f2dbd commit 7b53ae3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile.cache
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,14 @@ define GET_MOD_DEP_SHA
$(if $($(dfile)_MAIN_DEB),$($(dfile)_MAIN_DEB),$(dfile))) )

$(if $(MDEBUG), $(info $(1)_MOD_DEP_PKGS: $($(1)_MOD_DEP_PKGS)))
$(eval $(1)_DEP_MOD_SHA := $(shell git hash-object \
$(foreach dfile,$($(1)_MOD_DEP_PKGS), $($(dfile)_DEP_FLAGS_FILE) $($(dfile)_MOD_HASH_FILE) $($(dfile)_SMOD_HASH_FILE) ) \

# Warn if there is any missing dependency files
$(eval $(1)_DEP_MOD_SHA_FILES := $(foreach dfile,$($(1)_MOD_DEP_PKGS), \
$($(dfile)_DEP_FLAGS_FILE) $($(dfile)_MOD_HASH_FILE) $($(dfile)_SMOD_HASH_FILE)) )
$(eval $(1)_DEP_FILES_MISSING := $(filter-out $(wildcard $($(1)_DEP_MOD_SHA_FILES)),$($(1)_DEP_MOD_SHA_FILES)) )
$(if $($(1)_DEP_FILES_MISSING), $(warning "[ DPKG ] Dependecy file(s) are not found for $(1) : $($(1)_DEP_FILES_MISSING)))

$(eval $(1)_DEP_MOD_SHA := $(shell git hash-object $($(1)_DEP_MOD_SHA_FILES) \
| sha1sum | awk '{print substr($$1,0,23);}'))
endef

Expand Down
11 changes: 11 additions & 0 deletions rules/docker-iccpd.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

DPATH := $($(DOCKER_ICCPD)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-iccpd.mk rules/docker-iccpd.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

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

$(eval $(call add_dbg_docker,$(DOCKER_ICCPD),$(DOCKER_ICCPD_DBG)))
10 changes: 10 additions & 0 deletions rules/iccpd.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

SPATH := $($(ICCPD)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/iccpd.mk rules/iccpd.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))

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

0 comments on commit 7b53ae3

Please sign in to comment.