Skip to content

Commit

Permalink
Build both the regular and RPC version when the RPC profile is enabled (
Browse files Browse the repository at this point in the history
#1273)

When the RPC version needs to be built, the regular version of syncd
also needs to be built. Unfortunately, this is not easy to do with the
current build infra except for manually rerunning configure, removing
the built object files/binaries, and building the new config.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
  • Loading branch information
saiarcot895 authored Aug 9, 2023
1 parent 9e855c2 commit eb24302
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Standards-Version: 1.0.0

Package: syncd
Architecture: any
Build-Profiles: <syncd !rpc !vs>
Build-Profiles: <syncd !vs>
Depends: ${misc:Pre-Depends}
Recommends: ${shlibs:Depends}
Conflicts: syncd-rpc, syncd-vs
Expand Down
13 changes: 10 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ configure_opts += --disable-python2
endif

ifneq ($(filter syncd,$(DEB_BUILD_PROFILES)),)
ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),)
configure_opts += --enable-rpcserver
endif
ifneq ($(filter vs,$(DEB_BUILD_PROFILES)),)
configure_opts += --with-sai=vs
endif
Expand All @@ -58,7 +55,17 @@ override_dh_auto_configure:
dh_auto_configure -- ${SWSS_COMMON_CONFIG} $(configure_opts)

override_dh_install:
ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),)
dh_install -N syncd-rpc
# This is to build a RPC-enabled version, and package that version into syncd-rpc
dh_auto_configure -- ${SWSS_COMMON_CONFIG} $(configure_opts) --enable-rpcserver
make clean
dh_auto_build
make install DESTDIR=$(shell pwd)/debian/tmp
dh_install -N syncd
else
dh_install
endif
ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),)
sed -i 's|ENABLE_SAITHRIFT=0|ENABLE_SAITHRIFT=1 # Add a comment to fix https://github.com/Azure/sonic-buildimage/issues/2694 |' debian/syncd-rpc/usr/bin/syncd_init_common.sh
endif
Expand Down

0 comments on commit eb24302

Please sign in to comment.