From c3031f7137437350920fcd27a6fb8bc30aebd0a7 Mon Sep 17 00:00:00 2001 From: Brian Carr Date: Thu, 2 Jul 2026 18:28:12 +0300 Subject: [PATCH] Ship synced custom SAI headers in libsaivs-dev When vendor custom SAI headers are present in SAI/custom/, parse.pl emits "#include " into the generated saimetadata.h. Install those custom headers into libsaivs-dev so the include resolves in downstream builds (e.g. sonic-swss). libsaivs-dev conflicts with mlnx-sai, so there is no /usr/include/sai/saicustom.h overwrite clash. Guarded on header existence, so it is a no-op for builds without synced custom headers. Signed-off-by: Brian Carr --- debian/rules | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/rules b/debian/rules index f8df605757..78f5a7b2ca 100755 --- a/debian/rules +++ b/debian/rules @@ -72,6 +72,16 @@ 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 + # SAI may be built with vendor custom headers in SAI/custom/ and the generated + # saimetadata.h emitted in that case includes "#include ". Ship + # those custom headers in libsaivs-dev (the VS SAI dev package that is installed + # during downstream builds such as sonic-swss) so that include resolves. + # libsaivs-dev conflicts with vendor SAI dev packages, so the two never + # co-install and there is no file-overwrite clash. Guarded on existence so + # builds that don't include custom headers are unaffected. + if ls SAI/custom/*custom*.h >/dev/null 2>&1 && [ -d debian/libsaivs-dev/usr/include/sai ]; then \ + install -m 644 SAI/custom/*custom*.h debian/libsaivs-dev/usr/include/sai/; \ + fi override_dh_installinit: dh_installinit --init-script=syncd