Skip to content

Enhancement: Upgrade to libyang3 #22385

Description

@bradh352

Is it platform specific

generic

Importance or Severity

High

Description of the enhancement

SONiC currently uses 3 versions of libyang: 1.0.73, 1.0.184, and 2.1.148. All are end of life and potentially have security issues. The current release is 3.12.2 and that is what we are targeting here.

There are also numerous libyang related bugs that have been "worked around" in SONiC due to the shortcomings of libyang1. Hopefully upgrading to a modern version will resolve such issues.

Current Behavior

3 libyang versions

Proposed Behavior

single libyang version

PR Tracking Table

Legend: strikethrough = merged/done.

Foundation (merged)

PR description
#21679 Remove libyang 1.0.184; build libyang 3.12.2 + libyang-python 3.1.0; migrate FRR to libyang3; pre-stage sonic-yang-models test cases
#21719 Port sonic-yang-models test cases
#24414 sonic-yang-mgmt: helpers to keep dependents from calling into libyang directly
#26584 Port sonic-yang-mgmt from libyang1 to libyang3 Python bindings
sonic-net/sonic-utilities#4118 sonic-utilities: remove direct dependency on libyang
sonic-net/sonic-platform-daemons#589, sonic-net/sonic-platform-common#544 Interim: install both libyang1 and libyang3
sonic-net/sonic-swss-common#973 sonic-swss-common: port to libyang3

Code port (open)

PR description
sonic-net/sonic-mgmt-common#157 sonic-mgmt-common (Go/CVL): port to libyang3
sonic-net/sonic-mgmt#24821 sonic-mgmt: port tests/telemetry/validate_yang_events.py from libyang1 to libyang3 Python bindings (last import yang consumer in the test repo)

Buildimage — consolidated final change (open)

PR description
#27629 Migrate the remaining buildimage consumers to libyang3, remove the libyang3-dev-done coexistence shim and the post-FRR libyang3-dev UNINSTALLS, and delete libyang1 (rules/libyang.{mk,dep}, src/libyang). Supersedes and replaces former steps 4–7 (#21718, #21752, #21789, #21790, now closed). This is the last buildimage PR to complete the migration.

Per-repo CI/build: install libyang3 debs instead of libyang1 (open)

PR description
sonic-net/sonic-swss#4624 build-env / dev Dockerfile / README → versionless libyang3 globs
sonic-net/sonic-dbsyncd#82 azure-pipelines → libyang3_*.deb
sonic-net/sonic-restapi#189 Dockerfile / copy.sh / dependencies.conf → libyang3
sonic-net/sonic-snmpagent#377 azure-pipelines → libyang3_*.deb
sonic-net/sonic-dhcpmon#78 azure-pipelines download filter → libyang3
sonic-net/sonic-dhcp-relay#113 azure-pipelines + codeql → libyang3
sonic-net/sonic-linkmgrd#341 azure-pipelines download filters → libyang3
sonic-net/sonic-bmp#37 azure-pipelines install → libyang3_*.deb
sonic-net/sonic-gnmi#693 install-dependencies → libyang3
sonic-net/sonic-host-services#386 azure-pipelines install → libyang3_*.deb
sonic-net/sonic-mgmt-framework#161 azure-pipelines download/install → libyang3
sonic-net/sonic-platform-common#683 azure-pipelines: drop libyang1, keep libyang3
sonic-net/sonic-platform-daemons#827 azure-pipelines: drop libyang1, keep libyang3
sonic-net/sonic-stp#90 azure-pipelines install → libyang3_*.deb
sonic-net/sonic-utilities#4578 azure-pipelines / README → libyang3 (drop libyang-cpp, python3-yang→python3-libyang)
sonic-net/sonic-wpa-supplicant#115 azure-pipelines download filters → libyang3
sonic-net/sonic-platform-vpp#243 rules: migrate libyang1 make-vars (LIBYANG/LIBYANG_CPP/LIBYANG_PY3/LIBYANG2) to libyang3

Per-repo CI already migrated upstream (done)

PR description
sonic-net/sonic-sairedis#1916 sonic-sairedis: download/install libyang3
sonic-net/sonic-dash-ha#173 sonic-dash-ha: CI deps → libyang3

Order: merge the code ports (sonic-mgmt-common#157) and the per-repo CI PRs first, then #27629 last (it removes libyang1, so it must land only after every consumer is on libyang3).

Metadata

Metadata

Labels

Enhancement ➕Triagedthis issue has been triagedYANGYANG model related changes

Type

No type

Projects

Status
Done
Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions