From e50dfe06566c3efaf753bf5e286e52baad23aa88 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 28 May 2026 21:51:18 +0000 Subject: [PATCH 1/2] [azp] Download and install libyang3 instead of libyang Signed-off-by: Lawrence Lee --- .azure-pipelines/build-swss-template.yml | 4 +-- .azure-pipelines/build-template.yml | 8 +++--- .../test-docker-sonic-vs-template.yml | 27 ++++++++++++------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.azure-pipelines/build-swss-template.yml b/.azure-pipelines/build-swss-template.yml index 57998cb2bc..12b4f40414 100644 --- a/.azure-pipelines/build-swss-template.yml +++ b/.azure-pipelines/build-swss-template.yml @@ -72,7 +72,7 @@ jobs: target/debs/${{ parameters.debian_version }}/libnl-genl*.deb target/debs/${{ parameters.debian_version }}/libnl-route*.deb target/debs/${{ parameters.debian_version }}/libnl-nf*.deb - target/debs/${{ parameters.debian_version }}/libyang_*.deb + target/debs/${{ parameters.debian_version }}/libyang3_*.deb target/debs/${{ parameters.debian_version }}/libprotobuf*.deb target/debs/${{ parameters.debian_version }}/libprotoc*.deb target/debs/${{ parameters.debian_version }}/protobuf-compiler*.deb @@ -172,7 +172,7 @@ jobs: - script: | set -ex # install libyang before install libswsscommon - sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i $(find ./download -name libyang_*.deb) + sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i $(find ./download -name libyang3_*.deb) sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i $(find ./download -name *.deb) rm -rf download || true cat /etc/apt/sources.list diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index 75c8d42349..9a97f53eb0 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -140,7 +140,7 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download artifact: common-lib patterns: | - target/debs/${{ parameters.debian_version }}/libyang_*.deb + target/debs/${{ parameters.debian_version }}/libyang3_*.deb displayName: "Download libyang from amd64 common lib" - task: DownloadPipelineArtifact@2 condition: and(ne('${{ parameters.debian_version }}', 'trixie'), ne('${{ parameters.arch }}', 'amd64')) @@ -153,7 +153,7 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download artifact: common-lib.${{ parameters.arch }} patterns: | - target/debs/${{ parameters.debian_version }}/libyang_*.deb + target/debs/${{ parameters.debian_version }}/libyang3_*.deb - task: DownloadPipelineArtifact@2 condition: and(eq('${{ parameters.debian_version }}', 'trixie'), eq('${{ parameters.arch }}', 'amd64')) inputs: @@ -165,7 +165,7 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download artifact: common-lib patterns: | - target/debs/${{ parameters.debian_version }}/libyang_*.deb + target/debs/${{ parameters.debian_version }}/libyang3_*.deb target/debs/${{ parameters.debian_version }}/libpcre3_*.deb displayName: "Download libyang from amd64 common lib" - task: DownloadPipelineArtifact@2 @@ -179,7 +179,7 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download artifact: common-lib.${{ parameters.arch }} patterns: | - target/debs/${{ parameters.debian_version }}/libyang_*.deb + target/debs/${{ parameters.debian_version }}/libyang3_*.deb target/debs/${{ parameters.debian_version }}/libpcre3_*.deb displayName: "Download libyang from common lib" - script: | diff --git a/.azure-pipelines/test-docker-sonic-vs-template.yml b/.azure-pipelines/test-docker-sonic-vs-template.yml index 8649f6d214..3e1e37ef21 100644 --- a/.azure-pipelines/test-docker-sonic-vs-template.yml +++ b/.azure-pipelines/test-docker-sonic-vs-template.yml @@ -68,10 +68,8 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download artifact: common-lib patterns: | - target/debs/${{ parameters.debian_version }}/libyang-*_1.0*.deb - target/debs/${{ parameters.debian_version }}/libyang_1.0*.deb - target/debs/${{ parameters.debian_version }}/libyang-cpp_*.deb - target/debs/${{ parameters.debian_version }}/python3-yang_*.deb + target/debs/${{ parameters.debian_version }}/libyang3_*.deb + target/debs/${{ parameters.debian_version }}/libyang-dev_3*.deb displayName: "Download libyang from common lib" - task: DownloadPipelineArtifact@2 inputs: @@ -107,11 +105,22 @@ jobs: sudo sonic-sairedis/.azure-pipelines/build_and_install_module.sh - # Install libyang packages from downloaded artifacts - sudo dpkg -i $(Build.ArtifactStagingDirectory)/download/target/debs/${{ parameters.debian_version }}/libyang-*_1.0*.deb \ - $(Build.ArtifactStagingDirectory)/download/target/debs/${{ parameters.debian_version }}/libyang_1.0*.deb \ - $(Build.ArtifactStagingDirectory)/download/target/debs/${{ parameters.debian_version }}/libyang-cpp_*.deb \ - $(Build.ArtifactStagingDirectory)/download/target/debs/${{ parameters.debian_version }}/python3-yang_*.deb + # Install libyang packages from downloaded artifacts. Use apt rather + # than `dpkg -i` so libyang-dev's libpcre2-dev dep is auto-resolved + # from the host repos. + sudo apt-get install -y \ + $(Build.ArtifactStagingDirectory)/download/target/debs/${{ parameters.debian_version }}/libyang3_*.deb \ + $(Build.ArtifactStagingDirectory)/download/target/debs/${{ parameters.debian_version }}/libyang-dev_3*.deb + + # python3-libyang's bookworm .deb pins python3 (>= 3.11~, << 3.12) + # and the sonictest pool host runs Ubuntu 22.04 (python 3.10), so the + # .deb won't install regardless of resolver. Build the Python bindings + # from PyPI instead — same fallback as the inline amd64/ubuntu-22.04 + # job. --no-build-isolation + apt's python3-cffi sidesteps a cffi + # version-mismatch Exception that jammy's pip 22.0.2 build-isolation + # env otherwise triggers. + sudo apt-get install -y python3-cffi + sudo pip3 install --no-build-isolation 'libyang==3.3.0' sudo apt install -y $(Build.ArtifactStagingDirectory)/download/libprotobuf*_amd64.deb $(Build.ArtifactStagingDirectory)/download/libprotobuf-lite*_amd64.deb $(Build.ArtifactStagingDirectory)/download/python3-protobuf*_amd64.deb sudo apt install -y $(Build.ArtifactStagingDirectory)/download/libdashapi*.deb $(Build.ArtifactStagingDirectory)/download/libswsscommon_1.0.0_amd64.deb $(Build.ArtifactStagingDirectory)/download/python3-swsscommon_1.0.0_amd64.deb From d3d561e318640453279f962ed839dcd1922ab8fc Mon Sep 17 00:00:00 2001 From: Yuqing Zhao Date: Tue, 26 May 2026 14:42:32 +0800 Subject: [PATCH 2/2] azure-pipelines: Add libnexthopgroup to CI pipeline for swss compilation sonic-swss PR #4394 added -lnexthopgroup to fpmsyncd link dependencies, but only updated swss's own CI pipeline. This causes sairedis CI to fail when compiling swss because libnexthopgroup is missing from the build environment. Add libnexthopgroup deb download and installation to: - build-swss-template.yml (swss compilation environment) - build-docker-sonic-vs-template.yml (VS image build) - docker-sonic-vs/Dockerfile (VS image runtime) Signed-off-by: Yuqing Zhao --- .azure-pipelines/build-docker-sonic-vs-template.yml | 12 ++++++++++++ .azure-pipelines/build-swss-template.yml | 2 ++ .azure-pipelines/docker-sonic-vs/Dockerfile | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/build-docker-sonic-vs-template.yml b/.azure-pipelines/build-docker-sonic-vs-template.yml index 195ad7feff..7ecdfc4c9d 100644 --- a/.azure-pipelines/build-docker-sonic-vs-template.yml +++ b/.azure-pipelines/build-docker-sonic-vs-template.yml @@ -59,6 +59,17 @@ jobs: artifact: ${{ parameters.swss_artifact_name }} path: $(Build.ArtifactStagingDirectory)/download displayName: "Download sonic swss artifact" + - task: DownloadPipelineArtifact@2 + inputs: + source: specific + project: build + pipeline: Azure.sonic-buildimage.common_libs + artifact: common-lib + runVersion: 'latestFromBranch' + runBranch: 'refs/heads/$(BUILD_BRANCH)' + path: $(Build.ArtifactStagingDirectory)/download + patterns: '**/target/debs/*/libnexthopgroup_*.deb' + displayName: "Download sonic-buildimage libnexthopgroup package" - task: DownloadPipelineArtifact@2 inputs: source: specific @@ -106,6 +117,7 @@ jobs: mkdir -p .azure-pipelines/docker-sonic-vs/debs cp -v $(Build.ArtifactStagingDirectory)/download/*.deb .azure-pipelines/docker-sonic-vs/debs + find $(Build.ArtifactStagingDirectory)/download -name 'libnexthopgroup_*.deb' -exec cp "{}" .azure-pipelines/docker-sonic-vs/debs \; pushd .azure-pipelines diff --git a/.azure-pipelines/build-swss-template.yml b/.azure-pipelines/build-swss-template.yml index 12b4f40414..5bd4821510 100644 --- a/.azure-pipelines/build-swss-template.yml +++ b/.azure-pipelines/build-swss-template.yml @@ -73,6 +73,8 @@ jobs: target/debs/${{ parameters.debian_version }}/libnl-route*.deb target/debs/${{ parameters.debian_version }}/libnl-nf*.deb target/debs/${{ parameters.debian_version }}/libyang3_*.deb + target/debs/${{ parameters.debian_version }}/libnexthopgroup_*.deb + target/debs/${{ parameters.debian_version }}/libnexthopgroup-dev_*.deb target/debs/${{ parameters.debian_version }}/libprotobuf*.deb target/debs/${{ parameters.debian_version }}/libprotoc*.deb target/debs/${{ parameters.debian_version }}/protobuf-compiler*.deb diff --git a/.azure-pipelines/docker-sonic-vs/Dockerfile b/.azure-pipelines/docker-sonic-vs/Dockerfile index 6d6b795ae9..a30f6578bc 100644 --- a/.azure-pipelines/docker-sonic-vs/Dockerfile +++ b/.azure-pipelines/docker-sonic-vs/Dockerfile @@ -11,7 +11,7 @@ COPY ["debs", "/debs"] # same, even though contents have changed) are checked between the previous and current layer. RUN dpkg --remove --force-all libswsscommon RUN apt --fix-broken install -y -RUN dpkg --purge python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi +RUN dpkg --purge python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi libnexthopgroup RUN apt-get update @@ -44,6 +44,7 @@ RUN apt install -y /debs/libdashapi_1.0.0_amd64.deb \ /debs/libsairedis_1.0.0_amd64.deb \ /debs/libsaivs_1.0.0_amd64.deb \ /debs/syncd-vs_1.0.0_amd64.deb \ + /debs/libnexthopgroup_1.0.0_amd64.deb \ /debs/swss_1.0.0_amd64.deb RUN if [ "$need_dbg" = "y" ] ; then dpkg -i /debs/libsairedis-dbgsym_1.0.0_amd64.deb ; fi