Skip to content

[ci]: Install libyang3 for linkmgrd builds - #345

Merged
zjswhhh merged 1 commit into
sonic-net:masterfrom
zjswhhh:ci-install-libyang3-linkmgrd-20260615
Jun 15, 2026
Merged

[ci]: Install libyang3 for linkmgrd builds#345
zjswhhh merged 1 commit into
sonic-net:masterfrom
zjswhhh:ci-install-libyang3-linkmgrd-20260615

Conversation

@zjswhhh

@zjswhhh zjswhhh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Why I did it

linkmgrd CI currently assumes the common-lib artifact contains libyang_*.deb, but the current SONiC common-lib artifact publishes libyang3_*.deb and libyang-dev_*.deb. This causes Azure to download zero packages and then fail with dpkg --install needs at least one package archive file argument.

CodeQL also downloads libswsscommon without extracting the matching SONiC libyang3, so the link step cannot resolve libyang.so.3.

How I did it

  • Update Azure artifact patterns to download libyang3_*.deb and libyang-dev_*.deb.
  • Make Azure fail with a clear message if no libyang packages are downloaded.
  • Extract matching common-lib libyang3 packages in CodeQL before building against downloaded libswsscommon.
  • Add -Wl,-rpath-link for the extracted library directory so CodeQL's linker can resolve libyang.so.3.

How to verify it

  • Run the Azure sonic-linkmgrd pipeline.
  • Run the GitHub CodeQL workflow.
  • Confirm the libyang install step finds packages and CodeQL no longer fails with unresolved ly_* symbols from libswsscommon.

Signed-off-by: Jing Zhang <zhangjing@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@zjswhhh
zjswhhh marked this pull request as ready for review June 15, 2026 19:59
@zjswhhh
zjswhhh requested a review from lolyu as a code owner June 15, 2026 19:59
@zjswhhh

zjswhhh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

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

@zjswhhh
zjswhhh requested review from Ndancejic and prsunny June 15, 2026 20:18
Comment thread azure-pipelines.yml
patterns: |
target/debs/bookworm/libyang_*.deb
target/debs/bookworm/libyang3_*.deb
target/debs/bookworm/libyang-dev_*.deb

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: suggest pattern libyang-dev_3*.deb for the dev headers package instead. Shouldn't affect functionality since libyang1 is no longer being built anyways

@zjswhhh
zjswhhh merged commit 35954d8 into sonic-net:master Jun 15, 2026
10 checks passed
@zjswhhh
zjswhhh deleted the ci-install-libyang3-linkmgrd-20260615 branch June 15, 2026 23:19
@mssonicbld

Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202605: #347

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.

6 participants