Skip to content

Commit 548443b

Browse files
authored
[build] Fix sonic-utilities-data submodule dep (#22917)
Why I did it The sonic-utilities-data_1.0-1_all.deb target depends on sources from the src/sonic-utilities submodule. However, the cache dependency file does not list this submodule as a dependency. So, when the build cache is used, updates to the src/sonic-utilities submodule pointer do not trigger the necessary rebuild of sonic-utilities-data_1.0-1_all.deb, leading to a stale build output. How I did it Updated rules/sonic-utilities-data.dep to include the proper SMDEP rules. How to verify it Perform a build with the dpkg cache enabled Confirm the new output file target/debs/bookworm/sonic-utilities-data_1.0-1_all.deb.smdep is created, containing the submodule dependencies (smdeps) Archive the target/debs/bookworm/sonic-utilities-data_1.0-1_all.deb output outside the build workspace Clean the build workspace Update the src/sonic-utilities submodule pointer to a new commit that contains different source code Perform another build with the dpkg cache enabled Extract the previous and current sonic-utilities-data_1.0-1_all.deb outputs. Confirm that the contents of the debian packages are distinct and contain the expected source based on the respective src/sonic-utilities submodule pointers This is a build bug which silently results in incorrect build outputs when the dpkg cache is used. As such, it should be double committed. Tested branch (Please provide the tested image version) 202405 (6fad19a) Description for the changelog Fix submodule build dependency for sonic-utilities-data
1 parent 4ac68cf commit 548443b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rules/sonic-utilities-data.dep

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
SPATH := $($(SONIC_UTILITIES_DATA)_SRC_PATH)
22
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-utilities-data.mk rules/sonic-utilities-data.dep
33
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
4-
DEP_FILES += $(shell git ls-files $(SPATH))
4+
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))
55

66
$(SONIC_UTILITIES_DATA)_CACHE_MODE := GIT_CONTENT_SHA
77
$(SONIC_UTILITIES_DATA)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
88
$(SONIC_UTILITIES_DATA)_DEP_FILES := $(DEP_FILES)
9-
9+
$(SONIC_UTILITIES_DATA)_SMDEP_FILES := $(SMDEP_FILES)
10+
$(SONIC_UTILITIES_DATA)_SMDEP_PATHS := $(SPATH)

0 commit comments

Comments
 (0)