Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
libyang-dev \
libzmq3-dev \
libzmq5 \
swig3.0 \
Expand Down Expand Up @@ -131,7 +130,18 @@ jobs:
exit 0
fi

rm -rf /tmp/swss-common /tmp/swss-common.zip
# libswsscommon is built against libyang3 (libyang.so.3); the distro
# apt libyang on this runner is libyang1, so the link would fail with
# "libyang.so.3 ... not found". Stage the libyang3 debs into the same
# prefix as swss-common. The sonic-build artifacts REST API requires an
# exact filename (wildcards do not resolve), so fetch the bookworm debs
# directory as a zip and extract just the libyang3 debs with a glob to
# stay version-independent across libyang3 bumps.
curl -sL -o /tmp/bookworm-debs.zip "https://sonic-build.azurewebsites.net/api/sonic/artifacts?branchName=master&platform=vs&target=target/debs/bookworm&format=zip"
unzip -j -o /tmp/bookworm-debs.zip '*/libyang3_*.deb' '*/libyang-dev_*.deb' -d /tmp/libyang
for d in /tmp/libyang/*.deb; do dpkg-deb -x "$d" $(dirname $GITHUB_WORKSPACE); done

rm -rf /tmp/swss-common /tmp/swss-common.zip /tmp/libyang /tmp/bookworm-debs.zip
echo "installed=true" >> "$GITHUB_OUTPUT"
env:
SWSSCOMMON_VER: "1.0.0"
Expand All @@ -143,6 +153,10 @@ jobs:
sed -i "/JOBS := \$(subst -j,,\$(JOB_FLAG))/a JOBS := 1" Makefile
sed -i -e "s/ -flto//g" Makefile
sed -i '/-include objects.mk/a LIBS := -L'"$(dirname $GITHUB_WORKSPACE)"'/usr/lib/x86_64-linux-gnu \$(LIBS)' Makefile
# libswsscommon.so pulls in libyang.so.3 as an indirect dependency. ld
# does not search -L paths for indirect deps, only -rpath-link and
# LD_LIBRARY_PATH, so point it at the staged libyang3 in the prefix.
export LD_LIBRARY_PATH="$(dirname $GITHUB_WORKSPACE)/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
make all INCLUDES="-L$(dirname $GITHUB_WORKSPACE)/usr/lib/x86_64-linux-gnu -I$(dirname $GITHUB_WORKSPACE)/usr/include"

- name: Perform CodeQL Analysis
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib
patterns: |
target/debs/bookworm/libyang_*.deb
target/debs/bookworm/libyang3_*.deb
displayName: "Download libyang from common lib"
- script: |
set -ex
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib.arm64
patterns: |
target/debs/bookworm/libyang_*.deb
target/debs/bookworm/libyang3_*.deb
displayName: "Download libyang from common lib"
- script: |
set -ex
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib.armhf
patterns: |
target/debs/bookworm/libyang_*.deb
target/debs/bookworm/libyang3_*.deb
displayName: "Download libyang from common lib"
- script: |
set -ex
Expand Down
Loading