Skip to content

Commit a9298e2

Browse files
committed
ci: verify static driver links against OpenSSL 3.0
Add a Makefile target and CI steps that verify the static driver archive can link against OpenSSL 3.0.2 (our minimum supported version). The test copies the already-built static archive and pkg-config metadata into a sysroot alongside OpenSSL 3.0.2 headers and static libraries from a pinned Launchpad deb, then attempts to compile and link examples/ssl/ssl.c. If the build environment was contaminated (e.g. by Homebrew exposing a newer OpenSSL with IDEA or 3.3+ APIs), the archive will contain symbol references that don't exist in OpenSSL 3.0 and the link will fail — catching the regression from issue #455. The verification runs in both PR CI (after build-integration-test-bin) and packaging CI (after test-package-deb), since both produce the static archive in build/.
1 parent 176e259 commit a9298e2

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/build-cpack-packages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- name: Build and test DEB packages
4848
run: make test-package-deb
4949

50+
- name: Verify static driver links against OpenSSL 3.0 (issue #455)
51+
run: make verify-openssl-3.0-compat
52+
5053
- name: Collect artifacts
5154
if: inputs.save-artifacts
5255
run: make collect-package-artifacts

.github/workflows/build-lint-and-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
id: build-integration-test-bin
4848
run: make build-integration-test-bin
4949

50+
- name: Verify static driver links against OpenSSL 3.0 (issue #455)
51+
run: make verify-openssl-3.0-compat
52+
5053
- name: Save integration test binary
5154
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
5255
id: save-integration-test-bin

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,46 @@ build-integration-test-bin-if-missing:
275275
@cd "${BUILD_DIR}"
276276
cmake -DCASS_BUILD_INTEGRATION_TESTS=ON -DCMAKE_BUILD_TYPE=Release .. && (make -j 4 || make)
277277

278+
# =============================================================================
279+
# OpenSSL 3.0 Compatibility Verification
280+
# =============================================================================
281+
# Regression test for issue #455: ensures the static driver archive can link
282+
# against OpenSSL 3.0 (our minimum supported version). Rather than rebuilding
283+
# from source, this target uses the artifact already produced by the default
284+
# build (which enables both shared and static). If the archive references
285+
# symbols only available in OpenSSL >3.0 (e.g. due to build environment
286+
# contamination), the link fails.
287+
#
288+
# This target is Linux/amd64-only (matches our release artifact platform).
289+
# =============================================================================
290+
291+
OPENSSL_3_0_COMPAT_SYSROOT := /tmp/openssl-3.0-compat-sysroot
292+
OPENSSL_3_0_LIBSSL_DEV_URL := https://launchpad.net/ubuntu/+archive/primary/+files/libssl-dev_3.0.2-0ubuntu1_amd64.deb
293+
294+
verify-openssl-3.0-compat:
295+
@echo "=== Verifying static driver links against OpenSSL 3.0 (issue #455) ==="
296+
rm -rf "$(OPENSSL_3_0_COMPAT_SYSROOT)"
297+
DESTDIR="$(OPENSSL_3_0_COMPAT_SYSROOT)" cmake --install "$(BUILD_DIR)"
298+
curl -fL -o /tmp/libssl-dev_3.0.2.deb "$(OPENSSL_3_0_LIBSSL_DEV_URL)"
299+
dpkg-deb -x /tmp/libssl-dev_3.0.2.deb "$(OPENSSL_3_0_COMPAT_SYSROOT)"
300+
rm -f "$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/lib/x86_64-linux-gnu/libssl.so"
301+
rm -f "$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/lib/x86_64-linux-gnu/libcrypto.so"
302+
PKG_CONFIG_SYSROOT_DIR="$(OPENSSL_3_0_COMPAT_SYSROOT)" \
303+
PKG_CONFIG_PATH="$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/local/lib/x86_64-linux-gnu/pkgconfig:$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/lib/x86_64-linux-gnu/pkgconfig" \
304+
pkg-config --libs --static scylladb_static
305+
cc \
306+
$$(PKG_CONFIG_SYSROOT_DIR="$(OPENSSL_3_0_COMPAT_SYSROOT)" \
307+
PKG_CONFIG_PATH="$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/local/lib/x86_64-linux-gnu/pkgconfig:$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/lib/x86_64-linux-gnu/pkgconfig" \
308+
pkg-config --cflags scylladb_static) \
309+
examples/ssl/ssl.c \
310+
$$(PKG_CONFIG_SYSROOT_DIR="$(OPENSSL_3_0_COMPAT_SYSROOT)" \
311+
PKG_CONFIG_PATH="$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/local/lib/x86_64-linux-gnu/pkgconfig:$(OPENSSL_3_0_COMPAT_SYSROOT)/usr/lib/x86_64-linux-gnu/pkgconfig" \
312+
pkg-config --libs --static scylladb_static) \
313+
-o /tmp/openssl-3.0-compat-link-test
314+
@echo "=== OpenSSL 3.0 compatibility verified ==="
315+
rm -rf "$(OPENSSL_3_0_COMPAT_SYSROOT)" \
316+
/tmp/libssl-dev_3.0.2.deb /tmp/openssl-3.0-compat-link-test
317+
278318
build-examples:
279319
@echo "Building examples to ${EXAMPLES_DIR}"
280320
@mkdir "${BUILD_DIR}" >/dev/null 2>&1 || true

0 commit comments

Comments
 (0)