Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,30 @@ Standards-Version: 1.0.0

Package: swss
Architecture: any
Build-Profiles: <!asan>
Depends: ${shlibs:Depends}
Conflicts: swss-asan
Description: This package contains Switch State Service for SONiC project.

Package: swss-dbg
Architecture: any
Build-Profiles: <!asan>
Section: debug
Priority: extra
Depends: swss (=${binary:Version})
Description: debugging symbols for swss

Package: swss-asan
Architecture: any
Build-Profiles: <asan>
Depends: ${shlibs:Depends}
Conflicts: swss
Description: This package contains ASAN-instrumented Switch State Service for SONiC project.

Package: swss-dbg-asan
Architecture: any
Build-Profiles: <asan>
Section: debug
Priority: extra
Depends: swss-asan (=${binary:Version})
Description: debugging symbols for swss-asan
18 changes: 13 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include /usr/share/dpkg/default.mk
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

configure_opts =
ifeq ($(ENABLE_ASAN), y)
ifneq ($(filter asan,$(DEB_BUILD_PROFILES)),)
configure_opts += --enable-asan
endif

Expand All @@ -44,14 +44,22 @@ override_dh_auto_build:
# Build and test countersyncd Rust project
cargo build --release --locked

ifneq ($(filter asan,$(DEB_BUILD_PROFILES)),)
SWSS_PKG = swss-asan
SWSS_DBG_PKG = swss-dbg-asan
else
SWSS_PKG = swss
SWSS_DBG_PKG = swss-dbg
endif

override_dh_auto_install:
dh_auto_install --destdir=debian/swss
dh_auto_install --destdir=debian/$(SWSS_PKG)
ifeq ($(ENABLE_GCOV), y)
mkdir -p debian/swss/tmp/gcov
mkdir -p debian/$(SWSS_PKG)/tmp/gcov
lcov -c --directory . --no-external --exclude "$(shell pwd)/tests/*" --exclude "$(shell pwd)/**/tests/*" --ignore-errors gcov --output-file coverage.info
lcov --add-tracefile coverage.info -o coverage.info
lcov_cobertura coverage.info -o coverage.xml
find ./ -type f -regex '.*\.\(h\|cpp\|gcno\|info\)' | tar -cf debian/swss/tmp/gcov/gcov-source.tar -T -
find ./ -type f -regex '.*\.\(h\|cpp\|gcno\|info\)' | tar -cf debian/$(SWSS_PKG)/tmp/gcov/gcov-source.tar -T -
endif

override_dh_auto_clean:
Expand All @@ -60,4 +68,4 @@ override_dh_auto_clean:
cargo clean || true

override_dh_strip:
dh_strip --dbg-package=swss-dbg
dh_strip -p$(SWSS_PKG) --dbg-package=$(SWSS_DBG_PKG)
4 changes: 4 additions & 0 deletions debian/swss-asan.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
swssconfig/sample/netbouncer.json etc/swss/config.d
neighsyncd/restore_neighbors.py usr/bin
fpmsyncd/bgp_eoiu_marker.py usr/bin
target/release/countersyncd usr/bin
Loading