Skip to content

Fix sonic-swss-common builds#27836

Merged
yxieca merged 2 commits into
sonic-net:masterfrom
nexthop-ai:fix-swss-build
Jun 13, 2026
Merged

Fix sonic-swss-common builds#27836
yxieca merged 2 commits into
sonic-net:masterfrom
nexthop-ai:fix-swss-build

Conversation

@bgallagher-nexthop

@bgallagher-nexthop bgallagher-nexthop commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Why I did it

I noticed that the sonic-swss-common build was failing in sonic-net/sonic-swss-common#1205 because the python3-libyang*.deb were not being published by sonic-buildimage builds.

How I did it

This PR fixes the issue by making the common_libs pipeline actually publish python3-libyang.

How to verify it

Ran a local build:

make init
BLDENV=bookworm make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
BLDENV=bookworm SONIC_BUILD_JOBS=$(nproc) make -f Makefile.work lib-packages ENABLE_DOCKER_BASE_PULL=y

Verified that python3-libyang was built:

$> ls -lt target/debs/bookworm/ | grep libyang
-rw-r--r-- 1 bgallagher bgallagher   30284 Jun 11 21:47 python3-libyang_3.1.0-1_amd64.deb.log
-rw-r--r-- 1 bgallagher bgallagher   66648 Jun 11 21:47 python3-libyang_3.1.0-1_amd64.deb
-rw-r--r-- 1 bgallagher bgallagher     375 Jun 11 21:47 libyang-dev_3.12.2-1_amd64.deb-install.log
-rw-r--r-- 1 bgallagher bgallagher     436 Jun 11 21:47 libyang3_3.12.2-1_amd64.deb-install.log
-rw-r--r-- 1 bgallagher bgallagher     115 Jun 11 21:36 libyang-dev_3.12.2-1_amd64.deb.log
-rw-r--r-- 1 bgallagher bgallagher  829428 Jun 11 21:36 libyang-dev_3.12.2-1_amd64.deb
-rw-r--r-- 1 bgallagher bgallagher  656282 Jun 11 21:36 libyang3_3.12.2-1_amd64.deb.log
-rw-r--r-- 1 bgallagher bgallagher 1744356 Jun 11 21:36 libyang3-dbgsym_3.12.2-1_amd64.deb
-rw-r--r-- 1 bgallagher bgallagher  499644 Jun 11 21:36 libyang3_3.12.2-1_amd64.deb
-rw-r--r-- 1 bgallagher bgallagher   73504 Jun 11 21:36 libyang3-tools_3.12.2-1_amd64.deb
-rw-r--r-- 1 bgallagher bgallagher  132616 Jun 11 21:36 libyang3-tools-dbgsym_3.12.2-1_amd64.deb

Spun up a container, installed the packages and verified libyang can be imported in Python code:

docker run -it --rm -v $PWD/target/debs/bookworm:/debs \
  sonicdev-microsoft.azurecr.io:443/sonic-slave-bookworm:master-amd64 bash

(in the container)
root@668f226e35f3:/# sudo apt-get install -y /debs/libyang3_*.deb /debs/libyang-dev_3*.deb /debs/python3-libyang_*.deb
root@668f226e35f3:/# python3 -c 'import libyang; print("ok")'
ok

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202605

Tested branch (Please provide the tested image version)

Description for the changelog

Fix sonic-swss-common builds

Link to config_db schema for YANG module changes

N/A

Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the common_libs pipeline output so that python3-libyang is built (and therefore included in published artifacts), unblocking downstream builds like sonic-swss-common that depend on the Python libyang bindings.

Changes:

  • Extend the lib-packages make target to also build $(LIBYANG3_PY3) (python3-libyang) alongside existing common libraries.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 766647e into sonic-net:master Jun 13, 2026
28 checks passed
@mssonicbld

Copy link
Copy Markdown
Collaborator

The change is not in 202605 yet. @bgallagher-nexthop, please manually create the cherry pick PR for branch 202605.
You can ping the release branch owner(github account: vaibhavhd) to approve your cherry pick PR.
If this change is already in 202605, please comment "already in 202605". Thanks!

---Powered by SONiC BuildBot

@yijingyan2

Copy link
Copy Markdown
Contributor

Cherry-pick PR to 202605: #27881

@mssonicbld

Copy link
Copy Markdown
Collaborator

The change is already in 202605. Removing cherry pick conflict label...

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants