From 6917cb09c1b293769f3d5e0a40fc75e543645fed Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Wed, 20 Aug 2025 09:36:26 +0000 Subject: [PATCH] [build] Fix sonic-utilities-data submodule dep #### 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. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Updated `rules/sonic-utilities-data.dep` to include the proper `SMDEP` rules. #### How to verify it 1. Perform a build with the dpkg cache enabled 2. Confirm the new output file `target/debs/bookworm/sonic-utilities-data_1.0-1_all.deb.smdep` is created, containing the submodule dependencies (smdeps) 3. Archive the `target/debs/bookworm/sonic-utilities-data_1.0-1_all.deb` output outside the build workspace 4. Clean the build workspace 5. Update the `src/sonic-utilities` submodule pointer to a new commit that contains different source code 6. Perform another build with the dpkg cache enabled 7. 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 #### Which release branch to backport (provide reason below if selected) - [x] 202405 - [x] 202411 - [x] 202505 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) - [x] 202405 (6fad19aff0cf0cc2132db1de92c20d27e1daabe9) #### Description for the changelog Fix submodule build dependency for sonic-utilities-data #### Link to config_db schema for YANG module changes #### A picture of a cute animal (not mandatory but encouraged) --- rules/sonic-utilities-data.dep | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rules/sonic-utilities-data.dep b/rules/sonic-utilities-data.dep index b11d0a55440..abcddfaf02c 100644 --- a/rules/sonic-utilities-data.dep +++ b/rules/sonic-utilities-data.dep @@ -1,9 +1,10 @@ SPATH := $($(SONIC_UTILITIES_DATA)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-utilities-data.mk rules/sonic-utilities-data.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(SPATH)) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) $(SONIC_UTILITIES_DATA)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_UTILITIES_DATA)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_UTILITIES_DATA)_DEP_FILES := $(DEP_FILES) - +$(SONIC_UTILITIES_DATA)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_UTILITIES_DATA)_SMDEP_PATHS := $(SPATH)