Skip to content

Commit 3b91f17

Browse files
committed
Close the static-linking gap between local builds and shipped packages
The branch already fixed the in-tree static target, but CI still exposed gaps at the shipped-package boundary. This revision keeps the Windows OpenSSL path explicit, teaches Windows discovery about Chocolatey’s VC layout so package builds can find the installed libraries directly, and hardens the package smoke app so static pkg-config output is consumed in a CMake-safe way across Linux and macOS. It also installs the missing RPM-side zlib development package required by static OpenSSL consumers. Constraint: Windows package jobs may reuse Chocolatey OpenSSL instead of building vendored OpenSSL Constraint: Installed static consumers resolve link flags from pkg-config metadata, not build-tree CMake targets Rejected: Keep feeding pkg-config static output directly to target_link_libraries | breaks Apple framework flags under CMake Rejected: Treat the Windows package failure as transient and rerun only | package build should not depend on vendored OpenSSL when the installed layout is usable Confidence: medium Scope-risk: moderate Reversibility: clean Directive: Keep package smoke consumers aligned with pkg-config semantics, especially on Apple where frameworks are not ordinary libraries Tested: cmake -S . -B /tmp/cpp-rs-driver-cmake-check -G Ninja -DCMAKE_BUILD_TYPE=Release Tested: make check Tested: make run-test-unit Tested: cmake -S . -B /tmp/cpp-rs-driver-install-build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/cpp-rs-driver-install-prefix && cmake --build /tmp/cpp-rs-driver-install-build -j 4 && cmake --install /tmp/cpp-rs-driver-install-build Tested: PKG_CONFIG_PATH=/tmp/cpp-rs-driver-install-prefix/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig cmake -S packaging/smoke-test-app -B /tmp/cpp-rs-driver-smoke-build -G Ninja -DCMAKE_BUILD_TYPE=Release -DSCYLLA_SMOKE_BUILD_STATIC=ON && PKG_CONFIG_PATH=/tmp/cpp-rs-driver-install-prefix/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig cmake --build /tmp/cpp-rs-driver-smoke-build -j 4 Not-tested: Updated Windows and macOS package jobs were not rerun locally
1 parent 1958459 commit 3b91f17

12 files changed

Lines changed: 420 additions & 63 deletions

File tree

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

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,17 @@ jobs:
4444
steps:
4545
- uses: actions/checkout@v4
4646

47+
- uses: actions-rust-lang/setup-rust-toolchain@v1
48+
4749
- name: Build and test DEB packages
48-
run: make test-package-deb
50+
run: make test-package-deb SCYLLA_SMOKE_BUILD_STATIC=ON
51+
52+
- name: Verify static linking builds (regression test for issue #164)
53+
run: |
54+
sudo apt-get update -y
55+
make install-build-dependencies
56+
make build-static-integration-test-bin
57+
rm -rf build_static
4958
5059
- name: Collect artifacts
5160
if: inputs.save-artifacts
@@ -75,14 +84,14 @@ jobs:
7584
--health-retries 60
7685
steps:
7786
- name: Install dependencies
78-
run: dnf -y install git make cmake gcc-c++ findutils rpm-build ninja-build pkgconf-pkg-config openssl-devel clang
87+
run: dnf -y install git make cmake gcc-c++ findutils rpm-build ninja-build pkgconf-pkg-config openssl-devel zlib-devel clang
7988

8089
- uses: actions/checkout@v4
8190

8291
- uses: actions-rust-lang/setup-rust-toolchain@v1
8392

8493
- name: Build and test RPM packages
85-
run: make test-package-rpm-native SCYLLA_HOST=scylla SKIP_DOCKER_COMPOSE=1
94+
run: make test-package-rpm-native SCYLLA_HOST=scylla SKIP_DOCKER_COMPOSE=1 SCYLLA_SMOKE_BUILD_STATIC=ON
8695

8796
- name: Collect artifacts
8897
if: inputs.save-artifacts
@@ -107,7 +116,12 @@ jobs:
107116
run: brew install make
108117

109118
- name: Build and test macOS packages (PKG + DMG)
110-
run: gmake test-package-macos
119+
run: gmake test-package-macos SCYLLA_SMOKE_BUILD_STATIC=ON
120+
121+
- name: Verify static linking builds (regression test for issue #164)
122+
run: |
123+
gmake build-static-integration-test-bin
124+
rm -rf build_static
111125
112126
- name: Collect artifacts
113127
if: inputs.save-artifacts
@@ -126,8 +140,16 @@ jobs:
126140
steps:
127141
- uses: actions/checkout@v4
128142

143+
- uses: actions-rust-lang/setup-rust-toolchain@v1
144+
129145
- name: Build and test Windows packages (MSI)
130-
run: make test-package-windows
146+
run: make test-package-windows SCYLLA_SMOKE_BUILD_STATIC=ON
147+
148+
- name: Verify static linking builds (regression test for issue #164)
149+
run: |
150+
make build-static-integration-test-bin
151+
if (Test-Path build_static) { Remove-Item -Recurse -Force build_static }
152+
shell: pwsh
131153

132154
- name: Collect artifacts
133155
if: inputs.save-artifacts

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
env:
1010
CARGO_TERM_COLOR: always
1111
# Should include `INTEGRATION_TEST_BIN` from the `Makefile`
12-
# TODO: Remove `build/libscylla-cpp-driver.*` after https://github.com/scylladb/cpp-rs-driver/issues/164 is fixed.
1312
INTEGRATION_TEST_BIN: |
1413
build/cassandra-integration-tests
1514
build/libscylla-cpp-driver.*
@@ -45,6 +44,11 @@ jobs:
4544
id: build-integration-test-bin
4645
run: make build-integration-test-bin
4746

47+
- name: Verify static linking builds (regression test for issue #164)
48+
run: |
49+
make build-static-integration-test-bin
50+
rm -rf build_static
51+
4852
- name: Save integration test binary
4953
uses: actions/cache/save@v4
5054
id: save-integration-test-bin

Makefile

Lines changed: 114 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,11 @@ endif
193193
FULL_RUSTFLAGS := --cfg scylla_unstable --cfg cpp_integration_testing
194194

195195
CURRENT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
196-
BUILD_DIR := "${CURRENT_DIR}build"
196+
BUILD_DIR := $(CURRENT_DIR)build
197197
INTEGRATION_TEST_BIN := ${BUILD_DIR}/cassandra-integration-tests
198198
CMAKE_FLAGS ?=
199199
CMAKE_BUILD_TYPE ?= Release
200+
OPENSSL_WIN_VERSION ?= 1.1.1u
200201

201202
ifeq ($(OS_TYPE),macos)
202203
CMAKE_INSTALL_PREFIX ?= /usr/local
@@ -213,7 +214,7 @@ else
213214
endif
214215

215216
clean:
216-
rm -rf "${BUILD_DIR}"
217+
rm -rf "${BUILD_DIR}" "${STATIC_BUILD_DIR}"
217218

218219
update-apt-cache-if-needed:
219220
@# It searches for a file that is at most one day old.
@@ -274,6 +275,55 @@ build-integration-test-bin-if-missing:
274275
@cd "${BUILD_DIR}"
275276
cmake -DCASS_BUILD_INTEGRATION_TESTS=ON -DCMAKE_BUILD_TYPE=Release .. && (make -j 4 || make)
276277

278+
STATIC_BUILD_DIR := $(CURRENT_DIR)build_static
279+
280+
build-static-integration-test-bin:
281+
ifeq ($(OS_TYPE),windows)
282+
$(MAKE) .package-build-prepare-windows
283+
cmake -S . -B build_static -G "Visual Studio 17 2022" -A x64 -DCASS_BUILD_INTEGRATION_TESTS=ON -DCASS_USE_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DOPENSSL_VERSION=$(OPENSSL_WIN_VERSION)
284+
@pwsh -NoProfile -Command "\
285+
$$useExternalOpenSSL = ((Select-String -Path 'build_static\\CMakeCache.txt' -Pattern '^SCYLLA_OPENSSL_EXTERNAL_PROJECT:BOOL=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
286+
$$externalOpenSSLTarget = ((Select-String -Path 'build_static\\CMakeCache.txt' -Pattern '^SCYLLA_OPENSSL_EXTERNAL_TARGET:STRING=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
287+
if ($$useExternalOpenSSL -eq 'ON' -and $$externalOpenSSLTarget) { \
288+
cmake --build build_static --config Release --target $$externalOpenSSLTarget; \
289+
if ($$LASTEXITCODE -ne 0) { exit $$LASTEXITCODE } \
290+
}; \
291+
$$opensslIncDir = ((Select-String -Path 'build_static\\CMakeCache.txt' -Pattern '^OPENSSL_INCLUDE_DIR:PATH=' | Select-Object -First 1).Line -split '=', 2)[1]; \
292+
$$opensslSslLibPath = ((Select-String -Path 'build_static\\CMakeCache.txt' -Pattern '^OPENSSL_SSL_LIBRARY(_RELEASE)?:FILEPATH=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
293+
$$opensslCryptoLibPath = ((Select-String -Path 'build_static\\CMakeCache.txt' -Pattern '^OPENSSL_CRYPTO_LIBRARY(_RELEASE)?:FILEPATH=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
294+
if ($$opensslIncDir) { \
295+
$$env:OPENSSL_DIR = (Split-Path $$opensslIncDir -Parent); \
296+
$$env:OPENSSL_INCLUDE_DIR = $$opensslIncDir; \
297+
if (-not $$opensslSslLibPath) { \
298+
$$opensslSslLibPath = (Get-ChildItem -Path $$env:OPENSSL_DIR -Recurse -Include 'libssl*.lib','ssleay32*.lib' -File -ErrorAction SilentlyContinue | Select-Object -First 1).FullName; \
299+
} \
300+
if (-not $$opensslCryptoLibPath) { \
301+
$$opensslCryptoLibPath = (Get-ChildItem -Path $$env:OPENSSL_DIR -Recurse -Include 'libcrypto*.lib','libeay32*.lib' -File -ErrorAction SilentlyContinue | Select-Object -First 1).FullName; \
302+
} \
303+
$$opensslLibPath = if ($$opensslSslLibPath) { $$opensslSslLibPath } elseif ($$opensslCryptoLibPath) { $$opensslCryptoLibPath } else { '' }; \
304+
if ($$opensslLibPath) { \
305+
$$env:OPENSSL_LIB_DIR = Split-Path $$opensslLibPath -Parent; \
306+
} else { \
307+
$$env:OPENSSL_LIB_DIR = Join-Path $$env:OPENSSL_DIR 'lib'; \
308+
} \
309+
if ($$opensslSslLibPath -and $$opensslCryptoLibPath) { \
310+
$$opensslSslLibName = [System.IO.Path]::GetFileNameWithoutExtension($$opensslSslLibPath); \
311+
$$opensslCryptoLibName = [System.IO.Path]::GetFileNameWithoutExtension($$opensslCryptoLibPath); \
312+
$$env:OPENSSL_LIBS = \"$$opensslSslLibName`:`$$opensslCryptoLibName\"; \
313+
} \
314+
}; \
315+
cmake --build build_static --config Release; \
316+
if ($$LASTEXITCODE -ne 0) { exit $$LASTEXITCODE } \
317+
"
318+
build_static\Release\cassandra-integration-tests.exe --gtest_list_tests > NUL
319+
else
320+
@echo "Building integration test binary with STATIC linking to ${STATIC_BUILD_DIR}"
321+
@mkdir "${STATIC_BUILD_DIR}" >/dev/null 2>&1 || true
322+
@cd "${STATIC_BUILD_DIR}"
323+
cmake -DCASS_BUILD_INTEGRATION_TESTS=ON -DCASS_USE_STATIC_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && (make -j 4 || make)
324+
"${STATIC_BUILD_DIR}/cassandra-integration-tests" --gtest_list_tests > /dev/null
325+
endif
326+
277327
build-examples:
278328
@echo "Building examples to ${EXAMPLES_DIR}"
279329
@mkdir "${BUILD_DIR}" >/dev/null 2>&1 || true
@@ -345,14 +395,47 @@ endif
345395

346396
.package-configure: .package-build-prepare
347397
ifeq ($(OS_TYPE),windows)
348-
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DOPENSSL_VERSION=1.1.1u $(CMAKE_FLAGS)
398+
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DOPENSSL_VERSION=$(OPENSSL_WIN_VERSION) $(CMAKE_FLAGS)
349399
else
350400
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) -DCMAKE_INSTALL_PREFIX=$(CMAKE_INSTALL_PREFIX) $(CMAKE_FLAGS)
351401
endif
352402

353403
build-driver: .package-configure
354404
ifeq ($(OS_TYPE),windows)
355-
@pwsh -NoProfile -Command "$$opensslVersion = ((Select-String -Path 'build\\CMakeCache.txt' -Pattern '^OPENSSL_VERSION:STRING=' | Select-Object -First 1).Line -split '=', 2)[1]; $$opensslTarget = \"openssl-$${opensslVersion}-library\"; cmake --build build --config $(CMAKE_BUILD_TYPE) --target $$opensslTarget; $$env:OPENSSL_DIR = (Resolve-Path 'build\\libs\\openssl').Path; $$env:OPENSSL_INCLUDE_DIR = \"$$env:OPENSSL_DIR\\include\"; $$env:OPENSSL_LIB_DIR = \"$$env:OPENSSL_DIR\\lib\"; cmake --build build --config $(CMAKE_BUILD_TYPE)"
405+
@pwsh -NoProfile -Command "\
406+
$$useExternalOpenSSL = ((Select-String -Path 'build\\CMakeCache.txt' -Pattern '^SCYLLA_OPENSSL_EXTERNAL_PROJECT:BOOL=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
407+
$$externalOpenSSLTarget = ((Select-String -Path 'build\\CMakeCache.txt' -Pattern '^SCYLLA_OPENSSL_EXTERNAL_TARGET:STRING=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
408+
if ($$useExternalOpenSSL -eq 'ON' -and $$externalOpenSSLTarget) { \
409+
cmake --build build --config $(CMAKE_BUILD_TYPE) --target $$externalOpenSSLTarget; \
410+
if ($$LASTEXITCODE -ne 0) { exit $$LASTEXITCODE } \
411+
}; \
412+
$$opensslIncDir = ((Select-String -Path 'build\\CMakeCache.txt' -Pattern '^OPENSSL_INCLUDE_DIR:PATH=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
413+
$$opensslSslLibPath = ((Select-String -Path 'build\\CMakeCache.txt' -Pattern '^OPENSSL_SSL_LIBRARY(_RELEASE)?:FILEPATH=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
414+
$$opensslCryptoLibPath = ((Select-String -Path 'build\\CMakeCache.txt' -Pattern '^OPENSSL_CRYPTO_LIBRARY(_RELEASE)?:FILEPATH=' -ErrorAction SilentlyContinue | Select-Object -First 1).Line -split '=', 2)[1]; \
415+
if ($$opensslIncDir) { \
416+
$$env:OPENSSL_DIR = (Split-Path $$opensslIncDir -Parent); \
417+
$$env:OPENSSL_INCLUDE_DIR = $$opensslIncDir; \
418+
if (-not $$opensslSslLibPath) { \
419+
$$opensslSslLibPath = (Get-ChildItem -Path $$env:OPENSSL_DIR -Recurse -Include 'libssl*.lib','ssleay32*.lib' -File -ErrorAction SilentlyContinue | Select-Object -First 1).FullName; \
420+
} \
421+
if (-not $$opensslCryptoLibPath) { \
422+
$$opensslCryptoLibPath = (Get-ChildItem -Path $$env:OPENSSL_DIR -Recurse -Include 'libcrypto*.lib','libeay32*.lib' -File -ErrorAction SilentlyContinue | Select-Object -First 1).FullName; \
423+
} \
424+
$$opensslLibPath = if ($$opensslSslLibPath) { $$opensslSslLibPath } elseif ($$opensslCryptoLibPath) { $$opensslCryptoLibPath } else { '' }; \
425+
if ($$opensslLibPath) { \
426+
$$env:OPENSSL_LIB_DIR = Split-Path $$opensslLibPath -Parent; \
427+
} else { \
428+
$$env:OPENSSL_LIB_DIR = Join-Path $$env:OPENSSL_DIR 'lib'; \
429+
} \
430+
if ($$opensslSslLibPath -and $$opensslCryptoLibPath) { \
431+
$$opensslSslLibName = [System.IO.Path]::GetFileNameWithoutExtension($$opensslSslLibPath); \
432+
$$opensslCryptoLibName = [System.IO.Path]::GetFileNameWithoutExtension($$opensslCryptoLibPath); \
433+
$$env:OPENSSL_LIBS = \"$$opensslSslLibName`:`$$opensslCryptoLibName\"; \
434+
} \
435+
}; \
436+
cmake --build build --config $(CMAKE_BUILD_TYPE); \
437+
if ($$LASTEXITCODE -ne 0) { exit $$LASTEXITCODE } \
438+
"
356439
else
357440
cmake --build build --config $(CMAKE_BUILD_TYPE)
358441
endif
@@ -524,15 +607,20 @@ endif
524607
# =============================================================================
525608

526609
SMOKE_TEST_DIR := packaging/smoke-test-app
610+
SCYLLA_SMOKE_BUILD_STATIC ?= OFF
611+
SMOKE_TEST_CMAKE_FLAGS :=
612+
ifeq ($(SCYLLA_SMOKE_BUILD_STATIC),ON)
613+
SMOKE_TEST_CMAKE_FLAGS += -DSCYLLA_SMOKE_BUILD_STATIC=ON
614+
endif
527615

528616
# DEB package testing (Ubuntu/Debian)
529617
test-package-deb: build-package
530618
@echo "=== Testing DEB packages ==="
531619
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-deb
532620
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-deb
533-
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=DEB
534-
$(MAKE) -C $(SMOKE_TEST_DIR) install-app-deb
535-
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package
621+
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=DEB SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC) CMAKE_FLAGS="$(SMOKE_TEST_CMAKE_FLAGS)"
622+
$(MAKE) -C $(SMOKE_TEST_DIR) install-app-deb SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC)
623+
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC)
536624
@echo "=== DEB package test completed successfully ==="
537625
$(MAKE) -C $(SMOKE_TEST_DIR) remove-app-deb || true
538626
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-deb || true
@@ -549,7 +637,7 @@ test-package-rpm: build-package
549637
fedora:latest \
550638
bash -c ' \
551639
set -euo pipefail; \
552-
dnf -y install make cmake gcc-c++ findutils rpm-build; \
640+
dnf -y install make cmake gcc-c++ findutils rpm-build zlib-devel; \
553641
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-rpm; \
554642
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-rpm; \
555643
pc_file=$$(find /usr -name "scylla-cpp-driver.pc" 2>/dev/null | head -1); \
@@ -561,14 +649,22 @@ test-package-rpm: build-package
561649
if [ -n "$$lib_dir" ]; then \
562650
export LD_LIBRARY_PATH="$${lib_dir}:$${LD_LIBRARY_PATH:-}"; \
563651
fi; \
564-
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=RPM; \
652+
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=RPM SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC) CMAKE_FLAGS="$(SMOKE_TEST_CMAKE_FLAGS)"; \
565653
$(MAKE) -C $(SMOKE_TEST_DIR) install-app-rpm; \
566654
smoke_bin=$$(find /usr -name "scylla-cpp-driver-smoke-test" -type f 2>/dev/null | head -1); \
567655
if [ -z "$$smoke_bin" ]; then \
568656
echo "ERROR: smoke-test binary not found"; \
569657
exit 1; \
570658
fi; \
571-
"$$smoke_bin" 127.0.0.1 \
659+
"$$smoke_bin" 127.0.0.1; \
660+
if [ "$(SCYLLA_SMOKE_BUILD_STATIC)" = "ON" ]; then \
661+
smoke_static_bin=$$(find /usr -name "scylla-cpp-driver-smoke-test-static" -type f 2>/dev/null | head -1); \
662+
if [ -z "$$smoke_static_bin" ]; then \
663+
echo "ERROR: static smoke-test binary not found"; \
664+
exit 1; \
665+
fi; \
666+
"$$smoke_static_bin" 127.0.0.1; \
667+
fi \
572668
'
573669
@echo "=== RPM package test completed successfully ==="
574670
docker compose -f $(SMOKE_TEST_DIR)/docker-compose.yml down --remove-orphans || true
@@ -582,9 +678,9 @@ test-package-rpm-native: build-package
582678
@echo "=== Testing RPM packages (native) ==="
583679
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-rpm
584680
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-rpm
585-
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=RPM
681+
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=RPM SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC) CMAKE_FLAGS="$(SMOKE_TEST_CMAKE_FLAGS)"
586682
$(MAKE) -C $(SMOKE_TEST_DIR) install-app-rpm
587-
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package SCYLLA_HOST=$(SCYLLA_HOST) SKIP_DOCKER_COMPOSE=$(SKIP_DOCKER_COMPOSE)
683+
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package SCYLLA_HOST=$(SCYLLA_HOST) SKIP_DOCKER_COMPOSE=$(SKIP_DOCKER_COMPOSE) SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC)
588684
@echo "=== RPM package test completed successfully ==="
589685
$(MAKE) -C $(SMOKE_TEST_DIR) remove-app-rpm || true
590686
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-rpm || true
@@ -595,9 +691,9 @@ test-package-pkg: build-package
595691
@echo "=== Testing PKG packages ==="
596692
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-pkg
597693
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-pkg
598-
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=productbuild
694+
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=productbuild SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC) CMAKE_FLAGS="$(SMOKE_TEST_CMAKE_FLAGS)"
599695
$(MAKE) -C $(SMOKE_TEST_DIR) install-app-pkg
600-
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package
696+
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC)
601697
@echo "=== PKG package test completed successfully ==="
602698
$(MAKE) -C $(SMOKE_TEST_DIR) remove-app-pkg || true
603699
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-pkg || true
@@ -608,9 +704,9 @@ test-package-dmg: build-package
608704
@echo "=== Testing DMG packages ==="
609705
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-dmg
610706
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dmg
611-
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=DragNDrop
707+
$(MAKE) -C $(SMOKE_TEST_DIR) build-package CPACK_GENERATORS=DragNDrop SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC) CMAKE_FLAGS="$(SMOKE_TEST_CMAKE_FLAGS)"
612708
$(MAKE) -C $(SMOKE_TEST_DIR) install-app-dmg
613-
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package
709+
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC)
614710
@echo "=== DMG package test completed successfully ==="
615711
$(MAKE) -C $(SMOKE_TEST_DIR) remove-app-dmg || true
616712
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-dmg || true
@@ -621,9 +717,9 @@ test-package-msi: .windows-setup-wix build-package
621717
@echo "=== Testing MSI packages ==="
622718
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev
623719
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver
624-
$(MAKE) -C $(SMOKE_TEST_DIR) build-package
720+
$(MAKE) -C $(SMOKE_TEST_DIR) build-package SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC) CMAKE_FLAGS="$(SMOKE_TEST_CMAKE_FLAGS)"
625721
$(MAKE) -C $(SMOKE_TEST_DIR) install-app
626-
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package
722+
$(MAKE) -C $(SMOKE_TEST_DIR) test-app-package SCYLLA_SMOKE_BUILD_STATIC=$(SCYLLA_SMOKE_BUILD_STATIC)
627723
@echo "=== MSI package test completed successfully ==="
628724

629725
# Combined Linux package testing (DEB + RPM)

cmake/Dependencies.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ endif()
6767
#------------------------
6868

6969
if(CASS_USE_OPENSSL)
70+
set(SCYLLA_OPENSSL_EXTERNAL_PROJECT OFF CACHE BOOL
71+
"Whether Scylla builds OpenSSL via ExternalProject" FORCE)
72+
set(SCYLLA_OPENSSL_EXTERNAL_TARGET "" CACHE STRING
73+
"Name of the ExternalProject target that builds OpenSSL" FORCE)
74+
7075
if(NOT WIN32)
7176
set(_OPENSSL_ROOT_PATHS "${PROJECT_SOURCE_DIR}/lib/openssl/")
7277
set(_OPENSSL_ROOT_HINTS ${OPENSSL_ROOT_DIR} $ENV{OPENSSL_ROOT_DIR})
@@ -148,4 +153,3 @@ if(CASS_USE_BOOST_ATOMIC)
148153
add_definitions(-Wno-missing-field-initializers)
149154
endif()
150155
endif()
151-

cmake/ExternalProject-OpenSSL.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ endif()
4444

4545
# OpenSSL external project variables
4646
set(OPENSSL_LIBRARY_NAME "openssl-${OPENSSL_VERSION}-library")
47+
set(SCYLLA_OPENSSL_EXTERNAL_PROJECT ON CACHE BOOL
48+
"Whether Scylla builds OpenSSL via ExternalProject" FORCE)
49+
set(SCYLLA_OPENSSL_EXTERNAL_TARGET "${OPENSSL_LIBRARY_NAME}" CACHE STRING
50+
"Name of the ExternalProject target that builds OpenSSL" FORCE)
4751
set(OPENSSL_PROJECT_PREFIX ${CMAKE_BINARY_DIR}/external/openssl)
4852
set(OPENSSL_ARCHIVE_URL_PREFIX "https://github.com/openssl/openssl/archive/")
4953
set(OPENSSL_ARCHIVE_URL_SUFFIX ".tar.gz")

cmake/FindOPENSSL.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,24 @@ if(WIN32 AND NOT CYGWIN)
132132
# Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib
133133
if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
134134
set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
135+
set(_OPENSSL_MSVC_ARCH_DIR "x64")
135136
else()
136137
set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
138+
set(_OPENSSL_MSVC_ARCH_DIR "x86")
137139
endif()
138140

139141
if(OPENSSL_USE_STATIC_LIBS)
140142
set(_OPENSSL_PATH_SUFFIXES
143+
"lib/VC/${_OPENSSL_MSVC_ARCH_DIR}/MT"
144+
"VC/${_OPENSSL_MSVC_ARCH_DIR}/MT"
141145
"lib/VC/static"
142146
"VC/static"
143147
"lib"
144148
)
145149
else()
146150
set(_OPENSSL_PATH_SUFFIXES
151+
"lib/VC/${_OPENSSL_MSVC_ARCH_DIR}/${_OPENSSL_MSVC_RT_MODE}"
152+
"VC/${_OPENSSL_MSVC_ARCH_DIR}/${_OPENSSL_MSVC_RT_MODE}"
147153
"lib/VC"
148154
"VC"
149155
"lib"

0 commit comments

Comments
 (0)