From d92eade3d372c3e4613db59a10c50f14b58ac0e7 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Fri, 29 Sep 2023 14:47:14 -0700 Subject: [PATCH] [build]Fix FRR build cache issue (#16713) ### Why I did it When FRR is built with Cache enabled, the build failed with the following error logs ``` [2023-09-20T15:17:00.273Z] fatal: Unable to hash src/sonic-frr/frr/tests/topotests/grpc_basic/lib [2023-09-20T15:17:00.273Z] fatal: Unable to hash src/sonic-frr/frr/tests/topotests/ospfapi/lib [2023-09-20T15:17:00.273Z] make: *** [Makefile.cache:528: target/debs/bullseye/frr_8.5.1-sonic-0_amd64.deb.smdep] Error 123 [2023-09-20T15:17:00.273Z] make: *** Waiting for unfinished jobs.... ``` #### How I did it Currently symlinks are excluded in hardcoded fashion. With FRR upgrades new symlinks might get introduced. To overcome it modified the way in which symlinks are excluded by finding symlinks using find command #### How to verify it Build FRR with cache enabled --- rules/frr.dep | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/rules/frr.dep b/rules/frr.dep index 6ae216650932..d113202cf30a 100644 --- a/rules/frr.dep +++ b/rules/frr.dep @@ -9,15 +9,7 @@ DEP_FILES += $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files |grep - FRR_SPATH := $(SPATH)/frr SMDEP_FILES := $(addprefix $(FRR_SPATH)/,$(shell cd $(FRR_SPATH) && git ls-files \ | grep -Ev -e 'debian/changelog$$$$' \ - -e '^tests/topotests/grpc_basic/lib$$$$' \ - -e '^tests/topotests/ospfapi/lib$$$$' \ - -e '^tests/topotests/bgp_instance_del_test/ce[0-9]$$$$' \ - -e '^tests/topotests/bgp_instance_del_test/r[0-9]$$$$' \ - -e '^tests/topotests/bgp_instance_del_test/scripts$$$$' \ - -e '^tests/topotests/bgp_instance_del_test/customize.py$$$$' \ - -e '^tests/topotests/bgp_rfapi_basic_sanity_config2/customize.py$$$$' \ - -e '^tests/topotests/bgp_rfapi_basic_sanity_config2/scripts$$$$' \ - -e '^tests/topotests/bgp_rfapi_basic_sanity_config2/test_bgp_rfapi_basic_sanity_config2.py$$$$' \ + -e "$(find -L tests/ -xtype l)" \ )) $(FRR)_CACHE_MODE := GIT_CONTENT_SHA