[build]: add artifical dependency between libyang and frr

frr build requires libyang 1.0.184 which conflicts with
libyang 1.0.73. Solution here is to compile frr and libyang 1.0.184
first, and then uninstall libyang 1.0.184 after frr build.
Then, compile libyang 1.0.73 and all packages depend on it later.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
Guohan Lu 2020-12-30 15:08:12 -08:00
parent 91bf30422c
commit 9b2274a4f1
3 changed files with 17 additions and 3 deletions

View File

@ -10,6 +10,7 @@ export FRR_VERSION FRR_SUBVERSION FRR_BRANCH FRR_TAG
FRR = frr_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_$(CONFIGURED_ARCH).deb FRR = frr_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_$(CONFIGURED_ARCH).deb
$(FRR)_DEPENDS += $(LIBSNMP_DEV) $(LIBYANG1) $(LIBYANG1_DEV) $(FRR)_DEPENDS += $(LIBSNMP_DEV) $(LIBYANG1) $(LIBYANG1_DEV)
$(FRR)_RDEPENDS += $(LIBYANG1) $(FRR)_RDEPENDS += $(LIBYANG1)
$(FRR)_UNINSTALLS = $(LIBYANG1_DEV) $(LIBYANG1)
$(FRR)_SRC_PATH = $(SRC_PATH)/sonic-frr $(FRR)_SRC_PATH = $(SRC_PATH)/sonic-frr
SONIC_MAKE_DEBS += $(FRR) SONIC_MAKE_DEBS += $(FRR)

View File

@ -10,6 +10,9 @@ export LIBYANG_SUBVERSION
LIBYANG = libyang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb LIBYANG = libyang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb
$(LIBYANG)_SRC_PATH = $(SRC_PATH)/libyang $(LIBYANG)_SRC_PATH = $(SRC_PATH)/libyang
# introduce artifical dependency between LIBYANG and FRR
# make sure LIBYANG is compile after FRR
$(LIBYANG)_AFTER = $(FRR)
SONIC_MAKE_DEBS += $(LIBYANG) SONIC_MAKE_DEBS += $(LIBYANG)
LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb
@ -30,4 +33,7 @@ LIBYANG_PY2 = python2-yang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb
$(LIBYANG_PY2)_DEPENDS += $(LIBYANG) $(LIBYANG_CPP) $(LIBYANG_PY2)_DEPENDS += $(LIBYANG) $(LIBYANG_CPP)
$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY2))) $(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY2)))
$(eval $(call add_conflict_package,$(LIBYANG),$(LIBYANG1)))
$(eval $(call add_conflict_package,$(LIBYANG_DEV),$(LIBYANG1_DEV)))
export LIBYANG LIBYANG_DBG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2 export LIBYANG LIBYANG_DBG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2

View File

@ -369,6 +369,7 @@ SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES))
# $(SOME_NEW_FILE)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... # $(SOME_NEW_FILE)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ...
# SONIC_MAKE_FILES += $(SOME_NEW_FILE) # SONIC_MAKE_FILES += $(SOME_NEW_FILE)
$(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \
$$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \
$(call dpkg_depend,$(FILES_PATH)/%.dep) $(call dpkg_depend,$(FILES_PATH)/%.dep)
$(HEADER) $(HEADER)
@ -411,6 +412,7 @@ SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES))
# $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... # $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ...
# SONIC_MAKE_DEBS += $(SOME_NEW_DEB) # SONIC_MAKE_DEBS += $(SOME_NEW_DEB)
$(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \
$$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \
$(call dpkg_depend,$(DEBS_PATH)/%.dep) $(call dpkg_depend,$(DEBS_PATH)/%.dep)
$(HEADER) $(HEADER)
@ -448,6 +450,7 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS))
# $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... # $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ...
# SONIC_DPKG_DEBS += $(SOME_NEW_DEB) # SONIC_DPKG_DEBS += $(SOME_NEW_DEB)
$(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \
$$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \
$(call dpkg_depend,$(DEBS_PATH)/%.dep ) $(call dpkg_depend,$(DEBS_PATH)/%.dep )
$(HEADER) $(HEADER)
@ -516,7 +519,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_EXTRA_DEBS)) : $(DEBS_PATH)/% : .platform $$(
SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_EXTRA_DEBS)) SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_EXTRA_DEBS))
# Targets for installing debian packages prior to build one that depends on them # Targets for installing debian packages prior to build one that depends on them
SONIC_INSTALL_TARGETS = $(addsuffix -install,$(addprefix $(DEBS_PATH)/, \ SONIC_INSTALL_DEBS = $(addsuffix -install,$(addprefix $(DEBS_PATH)/, \
$(SONIC_ONLINE_DEBS) \ $(SONIC_ONLINE_DEBS) \
$(SONIC_COPY_DEBS) \ $(SONIC_COPY_DEBS) \
$(SONIC_MAKE_DEBS) \ $(SONIC_MAKE_DEBS) \
@ -524,7 +527,7 @@ SONIC_INSTALL_TARGETS = $(addsuffix -install,$(addprefix $(DEBS_PATH)/, \
$(SONIC_PYTHON_STDEB_DEBS) \ $(SONIC_PYTHON_STDEB_DEBS) \
$(SONIC_DERIVED_DEBS) \ $(SONIC_DERIVED_DEBS) \
$(SONIC_EXTRA_DEBS))) $(SONIC_EXTRA_DEBS)))
$(SONIC_INSTALL_TARGETS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(DEBS_PATH)/$$* $(SONIC_INSTALL_DEBS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(DEBS_PATH)/$$*
$(HEADER) $(HEADER)
[ -f $(DEBS_PATH)/$* ] || { echo $(DEBS_PATH)/$* does not exist $(LOG) && false $(LOG) } [ -f $(DEBS_PATH)/$* ] || { echo $(DEBS_PATH)/$* does not exist $(LOG) && false $(LOG) }
while true; do while true; do
@ -538,6 +541,7 @@ $(SONIC_INSTALL_TARGETS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -inst
done done
$(FOOTER) $(FOOTER)
############################################################################### ###############################################################################
## Python packages ## Python packages
############################################################################### ###############################################################################
@ -615,6 +619,9 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA
$(call SAVE_CACHE,$*,$@) $(call SAVE_CACHE,$*,$@)
fi fi
# Uninstall unneeded build dependency
$(call UNINSTALL_DEBS,$($*_UNINSTALLS))
$(FOOTER) $(FOOTER)
SONIC_TARGET_LIST += $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) SONIC_TARGET_LIST += $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS))
@ -1098,4 +1105,4 @@ jessie : $$(addprefix $(TARGET_PATH)/,$$(JESSIE_DOCKER_IMAGES)) \
.PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_STDEB_DEBS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure .PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_STDEB_DEBS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure
.INTERMEDIATE : $(SONIC_INSTALL_TARGETS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform .INTERMEDIATE : $(SONIC_INSTALL_DEBS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform