diff --git a/.gitmodules b/.gitmodules index b769fb0c2554..2041c543c15a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -112,8 +112,8 @@ [submodule "src/dhcpmon"] path = src/dhcpmon url = https://github.com/sonic-net/sonic-dhcpmon.git -[submodule "src/sonic-dash-api/sonic-dash-api"] - path = src/sonic-dash-api/sonic-dash-api +[submodule "src/sonic-dash-api"] + path = src/sonic-dash-api url = https://github.com/sonic-net/sonic-dash-api.git [submodule "platform/marvell-arm64/mrvl-prestera"] path = platform/marvell-arm64/mrvl-prestera diff --git a/rules/protobuf.mk b/rules/protobuf.mk index 5e50eac86292..866eb6b99f3e 100644 --- a/rules/protobuf.mk +++ b/rules/protobuf.mk @@ -1,32 +1,37 @@ # protobuf package +# Protobuf 3.21.12 has been released in bookworm, So we only need to build it +# in the bullseye environment. +ifeq ($(BLDENV),bullseye) -PROTOBUF_VERSION = 3.21.12 -PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 + PROTOBUF_VERSION = 3.21.12 + PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 -export PROTOBUF_VERSION -export PROTOBUF_VERSION_FULL + export PROTOBUF_VERSION + export PROTOBUF_VERSION_FULL -PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf -SONIC_MAKE_DEBS += $(PROTOBUF) + PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf + SONIC_MAKE_DEBS += $(PROTOBUF) -PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) + PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) -PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) + PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) -PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) + PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) -PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) -$(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) + PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) + $(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) -PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) -$(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) -$(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) + $(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) + $(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + +endif diff --git a/rules/sonic-dash-api.mk b/rules/sonic-dash-api.mk index e6d9e34c0395..742b2c3f9c6d 100644 --- a/rules/sonic-dash-api.mk +++ b/rules/sonic-dash-api.mk @@ -5,8 +5,10 @@ LIB_SONIC_DASH_API_VERSION = 1.0.0 LIB_SONIC_DASH_API = libdashapi_$(LIB_SONIC_DASH_API_VERSION)_$(CONFIGURED_ARCH).deb $(LIB_SONIC_DASH_API)_SRC_PATH = $(SRC_PATH)/sonic-dash-api -$(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) -$(LIB_SONIC_DASH_API)_RDEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) +ifeq ($(BLDENV),bullseye) + $(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) + $(LIB_SONIC_DASH_API)_RDEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) +endif SONIC_DPKG_DEBS += $(LIB_SONIC_DASH_API) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 95af2bd82e94..ef29115b0e9f 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -417,11 +417,8 @@ RUN apt-get update && apt-get install -y \ libauparse-dev \ auditd \ # For protobuf - dh-elpa \ - xmlto \ - rake-compiler \ - default-jdk \ - libgoogle-gson-java + protobuf-compiler \ + libprotobuf-dev {%- if CROSS_BUILD_ENVIRON == "y" %} # Arm vs. amd64 versions conflict - remove amd64 packages diff --git a/src/sonic-dash-api/.gitignore b/src/sonic-dash-api/.gitignore deleted file mode 100644 index ff64e429bd09..000000000000 --- a/src/sonic-dash-api/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -debian/sonic-dash-api diff --git a/src/sonic-dash-api/Makefile b/src/sonic-dash-api/Makefile deleted file mode 100644 index 0031800cced7..000000000000 --- a/src/sonic-dash-api/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -RM := rm -rf -CP := cp -rf -MKDIR := mkdir -MV := mv -LIBDASHAPI := libdashapi.so -BUILD_DIR := build -PYPKG_DIR := pypkg -DESTDIR := -DASH_API_PROTO_DIR := sonic-dash-api/proto -INSTALLED_HEADER_DIR := $(DESTDIR)/usr/include/dash_api -INSTALLED_LIB_DIR := $(DESTDIR)/usr/lib -INSTALLED_PYTHON_DIR := $(DESTDIR)/usr/lib/python3/dist-packages/dash_api - -all: compile_cpp_proto dashapi.so compile_py_proto - -compile_cpp_proto: - $(MKDIR) -p $(BUILD_DIR) - protoc -I=$(DASH_API_PROTO_DIR) --cpp_out=$(BUILD_DIR) $(DASH_API_PROTO_DIR)/*.proto - -dashapi.so: compile_cpp_proto - g++ -std=c++14 -fPIC -shared -o $(BUILD_DIR)/$(LIBDASHAPI) $(wildcard $(BUILD_DIR)/*.pb.cc) -lprotobuf - -compile_py_proto: - protoc -I=$(DASH_API_PROTO_DIR) --python_out=$(PYPKG_DIR) $(DASH_API_PROTO_DIR)/*.proto - -clean: - $(RM) $(BUILD_DIR) - $(RM) $(PYPKG_DIR)/*_pb2.py - -install: - $(MKDIR) -p $(INSTALLED_HEADER_DIR) - $(CP) $(BUILD_DIR)/*.pb.h $(INSTALLED_HEADER_DIR) - $(MKDIR) -p $(INSTALLED_LIB_DIR) - $(CP) $(BUILD_DIR)/$(LIBDASHAPI) $(INSTALLED_LIB_DIR) - $(MKDIR) -p $(INSTALLED_PYTHON_DIR) - $(CP) $(PYPKG_DIR)/* $(INSTALLED_PYTHON_DIR) - -uninstall: - $(RM) $(INSTALLED_HEADER_DIR) - $(RM) $(INSTALLED_LIB_DIR)/$(LIBDASHAPI) - $(RM) $(INSTALLED_PYTHON_DIR) - -.PHONY: uninstall clean diff --git a/src/sonic-dash-api/debian/changelog b/src/sonic-dash-api/debian/changelog deleted file mode 100644 index e5cb52398c4c..000000000000 --- a/src/sonic-dash-api/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -sonic (1.0.0) stable; urgency=medium - - * Initial release. - - -- Ze Gan Wed, 14 Jun 2023 12:00:00 -0800 - diff --git a/src/sonic-dash-api/debian/compat b/src/sonic-dash-api/debian/compat deleted file mode 100644 index 9d607966b721..000000000000 --- a/src/sonic-dash-api/debian/compat +++ /dev/null @@ -1 +0,0 @@ -11 \ No newline at end of file diff --git a/src/sonic-dash-api/debian/control b/src/sonic-dash-api/debian/control deleted file mode 100644 index 545204fbe7da..000000000000 --- a/src/sonic-dash-api/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: sonic -Maintainer: Ze Gan -Section: net -Priority: optional -Build-Depends: dh-exec (>=0.3), debhelper (>= 12), autotools-dev, -Standards-Version: 1.0.0 - -Package: libdashapi -Architecture: any -Build-Depends: protobuf-compiler (>=3.21.12), libprotobuf-dev (>=3.21.12) -Depends: libprotobuf32 (>=3.21.12), libprotobuf-lite32 (>=3.21.12) -Section: libs -Description: DASH API definition for the SONiC project. diff --git a/src/sonic-dash-api/debian/rules b/src/sonic-dash-api/debian/rules deleted file mode 100755 index e661a7acd0bf..000000000000 --- a/src/sonic-dash-api/debian/rules +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/make -f -#export DH_VERBOSE = 1 - -%: - dh $@ - -override_dh_auto_build: - make all diff --git a/src/sonic-dash-api/pypkg/__init__.py b/src/sonic-dash-api/pypkg/__init__.py deleted file mode 100644 index ade95c521abf..000000000000 --- a/src/sonic-dash-api/pypkg/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import sys -import os - - -sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) diff --git a/src/sonic-dash-api/sonic-dash-api b/src/sonic-dash-api/sonic-dash-api deleted file mode 160000 index 3f728d1bbf65..000000000000 --- a/src/sonic-dash-api/sonic-dash-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f728d1bbf65d2e8c41bdc023d5c07702a7f848b diff --git a/src/sonic-swss b/src/sonic-swss index 2209977a66ae..0cd28bda08dd 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 2209977a66aed49786d6e40018feac800aff0d13 +Subproject commit 0cd28bda08dd777938d0b911b21bd7687b85d0ef