Conversation
nazariig
requested review from
abelamit,
dgsudharsan,
keboliu,
liat-grozovik,
moshemos,
oleksandrivantsiv and
volodymyrsamotiy
September 11, 2026 12:41
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
volodymyrsamotiy
approved these changes
Sep 14, 2026
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
nazariig
force-pushed
the
202605-dbg-build-nvda
branch
from
September 18, 2026 08:08
c72e4ab to
00b50ec
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com
Why I did it
Make the NVIDIA SAI/SDK packages honor SONiC's debug/profiling build switches and
ship correct Debian metadata, and stop registering build artifacts that the
recipes cannot produce.
Five problems are addressed.
1.
SONIC_DEBUGGING_ON/SONIC_PROFILING_ONhad no effect on the SDKslave.mkexportsDEB_BUILD_OPTIONS=nostrip(debugging) ornostrip noopt(profiling). Those are debhelper options.
sys-sdkis packaged by CMake/CPack,which never reads
DEB_BUILD_OPTIONS, so the SDK was built and packaged exactlythe same way in every mode:
.ddebSource-level debugging of the SDK inside
syncdwas therefore impossible evenwith profiling enabled:
gdbcould resolve function names, but notfile:line.2.
sys-sdkpackages had an emptyDepends:fieldCPack does not run
dpkg-shlibdepsand does not convert component dependenciesinto Debian dependencies unless explicitly told to. Both generated packages
shipped with no
Depends:at all, sodpkgcould not enforce anything:sys-sdk-devdid not require its runtime package, and the runtime package didnot require
libc6/libnl/libxml2. Correct install order happened only asa side effect of the Make dependency graph.
3.
mlnx-saidid not depend on the SDKsys-sdkpublished noshlibscontrol file, so when SAI randh_shlibdepstherewas no SONAME-to-package mapping for the SDK shared libraries. SAI's
debian/rulesrunsdh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info,so the missing information was not an error — the build simply produced an
mlnx-saipackage with no dependency on the SDK it links against, and installingit on a system without the SDK would only fail at runtime.
4. dbgsym packages were demanded in cases where nothing produces them
The dbgsym artifacts were declared without regard to whether the selected build
mode actually emits them:
MLNX_SDK_DBG_DEBSalways listedsys-sdk-*-dbgsym.ddeb, anddocker-syncd-mlnx.mkalways appended it to the-dbgimage, while thepackage itself was registered only for source builds — and, once
nostripisin
DEB_BUILD_OPTIONS, is not produced by the source build eithermlnx-sai-dbgsymwas registered unconditionally as a derived package of theruntime deb, so on a
nostripbuild the recipe was expected to emit a filethat dh_strip never creates, and on the download path the asset was fetched on
every build even when no
-dbgimage was requestedA dbgsym that nothing can produce shows up as a missing prerequisite:
5.
_DEPENDSmixed compile-time headers with runtime install ordering$(MLNX_SAI)_DEPENDSunconditionally listedMLNX_SDK_DEBS(sys-sdk-dev).Installing SAI in the slave therefore always installed SDK headers, including on
the default path where SAI is downloaded as a prebuilt asset and nothing compiles
against the SDK.
Work item tracking
How I did it
slave.mk— introduceSPLIT_DBGSYMMoved the
SONIC_DEBUGGING_ON/SONIC_PROFILING_ONhandling next to the otherdebug switches and made it set a single variable that package rules can read:
SPLIT_DBGSYM=y(default, production): runtime deb is stripped and a dbgsympackage exists.
SPLIT_DBGSYM=n: DWARF stays in the runtime deb and no dbgsympackage is produced, so no rule may register one. This is independent of
INSTALL_DEBUG_TOOLS, which only decides whether debug images ship in theinstaller.
platform/mellanox/sdk-src/sys-sdk/Makefile— mapDEB_BUILD_OPTIONSonto CMake/CPackCollected the flags into
SDK_CMAKE_ARGS/SDK_CPACK_ARGSand translated thedebhelper options that CPack cannot see:
noopt->-DCMAKE_BUILD_TYPE=Debug(configure time)nostrip->-D CPACK_DEBIAN_DEBUGINFO_PACKAGE=OFF(package time)and added the missing packaging metadata:
-D CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS=ONand-D CPACK_COMPONENT_DEV_DEPENDS=main---devnow depends on the runtimepackage. The component ids come from the SDK CMake project (
dev/main);CPack resolves them to the generated package names, so nothing here hardcodes
the runtime package name.
-D CPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON-- runtime deb gets its ownDepends:generated from the libraries it links against.-D CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS=ON-- the runtime deb ships ashlibsfile so other packages (SAI) can resolve SDK SONAMEs.platform/mellanox/sdk.mk/mlnx-sai.mk— declare only what each path deliversBoth files now split their declarations by acquisition method, and
_DEPENDSisscoped to what that path actually needs:
_DEPENDSsys-sdk-dev,libnl-route-3-devsys-sdk,libnl-route-3-200_DEPENDSlibnl-3-dev,libnl-genl-3-devlibnl-3-200,libnl-genl-3-200SPLIT_DBGSYM=y-dev_DEPENDSon runtime_RDEPENDSis unchanged, so what lands in the docker images is identical.platform/mellanox/mlnx-sai/Makefile/sdk-src/sys-sdk/Makefile— conditional derived targetsDERIVED_TARGETSnow includes the dbgsym target only whennostripis absent, sothe recipe never tries to
mva file that was not generated.platform/mellanox/docker-syncd-mlnx.mk— consumer side_DBG_DEPENDSasks for a dbgsym package only in the combinations where oneexists: source builds only when
SPLIT_DBGSYM=y, downloaded packages always. Onnostripbuilds the symbols are already inside the runtime debs the base imageinstalls, so nothing extra is added.
How to verify it
Production build (default,
SPLIT_DBGSYM=y)Profiling build (
SONIC_PROFILING_ON=y,SPLIT_DBGSYM=n)-dbgsyncd image and confirm it still builds with no missingdbgsym prerequisite.
gdbtosyncdand confirmfile:linebreakpoints in SDK sources nowresolve.
Dependency laziness
syncdand confirmsys-sdk-devis not installed in the slave.sys-sdk-devis installed before SAI compiles.Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Which release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): N/A
Failure type: N/A
Tested branch
Test result
Verified on trixie / amd64 with
sys-sdk 1.mlnx.4.10.1106andmlnx-sai 1.mlnx.SAIBuild2605.37.0.31, both built from source:SPLIT_DBGSYM=y) -- dbgsym packages emitted for bothcomponents, runtime debs stripped (no
.debug_info,.gnu_debuglinkpresent),DWARF lives in the dbgsym packages, and
DW_AT_producerreports an optimizedcompile (
-O3/-O2, not-O0)SONIC_PROFILING_ON=y(SPLIT_DBGSYM=n) -- no dbgsym package emitted foreither component,
.debug_infopresent in the SDK and SAI shared libraries,and
DW_AT_producerreports-ggdb -O0for the compile unitssys-sdkDepends:populated fromdpkg-shlibdeps;sys-sdk-devdepends onsys-sdk-main (= 1.mlnx.4.10.1106);sys-sdkshipsa
shlibsfile, andmlnx-saiDepends:resolvessys-sdk-main (= 1.mlnx.4.10.1106)through it-dbgsyncd docker image builds with no missing dbgsym prerequisitegdbonsyncdresolvesfile:linebreakpoints in SDKsources
Description for the changelog
Link to config_db schema for YANG module changes
Details if related
master: [NVIDIA]: Add SAI/SDK Debian packaging for debugging/profiling builds #29404A picture of a cute animal (not mandatory but encouraged)