sonic-buildimage/rules/frr.dep
Sudharsan Dhamal Gopalarathnam 2afd3829ad
[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
2023-09-29 14:47:14 -07:00

20 lines
750 B
Plaintext

SPATH := $($(FRR)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/frr.mk rules/frr.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files |grep -Ev '^frr$$$$'))
# Account for source files under the frr submodule directory as well.
# Remove all the symbolic link files
FRR_SPATH := $(SPATH)/frr
SMDEP_FILES := $(addprefix $(FRR_SPATH)/,$(shell cd $(FRR_SPATH) && git ls-files \
| grep -Ev -e 'debian/changelog$$$$' \
-e "$(find -L tests/ -xtype l)" \
))
$(FRR)_CACHE_MODE := GIT_CONTENT_SHA
$(FRR)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(FRR)_DEP_FILES := $(DEP_FILES)
$(FRR)_SMDEP_FILES := $(SMDEP_FILES)
$(FRR)_SMDEP_PATHS := $(FRR_SPATH)