Skip to content

azure-pipelines: migrate libyang1 deb install to libyang3 - #341

Closed
bhouse-nexthop wants to merge 3 commits into
sonic-net:masterfrom
bhouse-nexthop:bhouse.libyang3-debs
Closed

azure-pipelines: migrate libyang1 deb install to libyang3#341
bhouse-nexthop wants to merge 3 commits into
sonic-net:masterfrom
bhouse-nexthop:bhouse.libyang3-debs

Conversation

@bhouse-nexthop

@bhouse-nexthop bhouse-nexthop commented May 31, 2026

Copy link
Copy Markdown

Description of PR

Summary:
sonic-buildimage no longer builds the legacy libyang1 deb (libyang_1.0.73); it now builds only libyang3. Updated the three DownloadPipelineArtifact filter patterns in azure-pipelines.yml from target/debs/bookworm/libyang_*.deb to target/debs/bookworm/libyang3_*.deb so CI pulls the libyang3 deb. The install steps use a generic dpkg -i $(find ./download -name *.deb), so no install-command change was needed.

Part of sonic-net/sonic-buildimage#22385.

Fixes # (N/A — tracked under sonic-net/sonic-buildimage#22385)

Type of change

  • Bug fix
  • New feature
  • Doc/Design
  • Unit test

Approach

What is the motivation for this PR?

Once libyang1 is removed from sonic-buildimage, the old libyang_*.deb download filter matches nothing and CI fails to install libyang.

Work item tracking
  • Microsoft ADO (number only):

How did you do it?

Replaced libyang_*.deb with libyang3_*.deb in all three artifact-download filters (amd64 / arm64 / armhf common-lib).

How did you verify/test it?

Re-grepped for libyang1 references — none remain except the CodeQL/LGTM distro-apt libyang-dev entries (not sourced from sonic-buildimage artifacts), which were intentionally left unchanged.

Any platform specific information?

None.

Documentation

No documentation changes required.

sonic-buildimage no longer builds the libyang1 debs (libyang_1.0.73,
libyang-cpp, python3-yang); the common_libs pipeline now produces only
libyang3. Update the common-lib artifact download patterns to fetch the
libyang3 deb instead of the removed libyang_*.deb, using a versionless
glob. The install step uses a generic find for *.deb and needs no change.

Part of sonic-net/sonic-buildimage#22385.

Signed-off-by: Brad House <bhouse@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@rookie-who

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 341 in repo sonic-net/sonic-linkmgrd

@rookie-who rookie-who left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — download patterns correctly updated across all three arch targets.

@vaibhavhd

Copy link
Copy Markdown

/azp run

@azure-pipelines

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

vaibhavhd
vaibhavhd previously approved these changes Jun 3, 2026
@bhouse-nexthop

Copy link
Copy Markdown
Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

No failed(or canceled) stages or jobs found in the most recent build 1129408.

@bhouse-nexthop

Copy link
Copy Markdown
Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

No failed(or canceled) stages or jobs found in the most recent build 1129408.

lolyu
lolyu previously approved these changes Jun 15, 2026
@lolyu

lolyu commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

The codeql is failing for the same root cause, can you fix it as well?

@bhouse-nexthop

Copy link
Copy Markdown
Author

/azpw run

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

No failed(or canceled) stages or jobs found in the most recent build 1129408.

The CodeQL job runs on ubuntu-22.04 where apt 'libyang-dev' is libyang1
(1.0.225), but the libswsscommon.so it downloads is built against
libyang3, so the link fails with 'libyang.so.3 ... not found' /
undefined references to ly_ctx_new, lyd_value_get_canonical, etc., and
CodeQL reports a configuration error (no code compiled).

Drop the apt libyang-dev and stage the libyang3 debs into the same
prefix as swss-common. The artifacts REST API needs an exact filename
(no globs), so fetch the bookworm debs zip and extract just the libyang3
debs with a glob to stay version-independent across libyang3 bumps.

Signed-off-by: Brad House <bhouse@nexthop.ai>
@bhouse-nexthop
bhouse-nexthop dismissed stale reviews from lolyu and vaibhavhd via 0061c11 June 15, 2026 13:39
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

Staging libyang3 into the prefix was not enough: libyang.so.3 is an
indirect dependency (needed by libswsscommon.so, not linkmgrd directly),
and ld does not search -L paths for indirect deps -- only -rpath-link
and LD_LIBRARY_PATH. Export LD_LIBRARY_PATH pointing at the staged
libyang3 so the link resolves ly_ctx_new, lyd_value_get_canonical, etc.

Signed-off-by: Brad House <bhouse@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@bhouse-nexthop

Copy link
Copy Markdown
Author

Looks like #345 reinvented my PR (not sure why), closing this since that one is already merged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants