Skip to content

Commit 849c8d7

Browse files
committed
Add validation for vcpkg Linux binary dependencies in CI workflow
This aims to enhance security and reliability in the build process.
1 parent eb9fbe2 commit 849c8d7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,23 @@ jobs:
6161
- name: '[CI Only] Perform CodeQL Analysis'
6262
if: inputs.codeql && matrix.preset != 'linux-arm64-ci'
6363
uses: github/codeql-action/analyze@v3
64+
- name: Validate vcpkg Linux binary dependencies
65+
if: matrix.preset == 'linux-ci' || matrix.preset == 'linux-arm64-ci'
66+
run: |
67+
VCPKG_BIN="out/build/${{ matrix.preset }}/vcpkg"
68+
if [ ! -x "$VCPKG_BIN" ]; then
69+
echo "vcpkg binary not found at $VCPKG_BIN"
70+
exit 1
71+
fi
72+
73+
echo "Running ldd on $VCPKG_BIN"
74+
ldd "$VCPKG_BIN"
75+
76+
# Fail if vcpkg links against system curl or OpenSSL
77+
if ldd "$VCPKG_BIN" | grep -E 'libcurl\.so|libssl\.so|libcrypto\.so'; then
78+
echo "ERROR: vcpkg is linked against forbidden libraries (libcurl/libssl/libcrypto)"
79+
exit 1
80+
fi
6481
- name: Run vcpkg and vcpkg-artifacts unit tests
6582
run: ctest --preset ${{ matrix.preset }} --output-on-failure 2>&1
6683
- name: Get microsoft/vcpkg pinned sha into VCPKG_SHA

0 commit comments

Comments
 (0)