Skip to content

Commit d7f812b

Browse files
committed
ci: build macOS .dylib on test runners too; drop committed binaries
Remove the committed darwin-aarch64/darwin-x86-64 libquestdb.dylib and build them on the macOS runners, matching the Linux/Windows approach. No native binaries remain committed; all are compiled during the test CI. - build_native.yaml: add a macOS build step (brew cmake/nasm, MACOSX_DEPLOYMENT_TARGET=13.0), detect darwin-aarch64 vs darwin-x86-64 via uname -m, and copy the dylib into src/main/resources/.../bin/<platform>/. - Init the zstd submodule on all platforms (it was skipped on Darwin). Release artifacts are still produced by the release GitHub Action.
1 parent 2e22da9 commit d7f812b

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

ci/build_native.yaml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# "Build and Push Release CXX Libraries" GitHub Action. So the test CI has to
66
# compile them locally before running the tests.
77
#
8-
# macOS ships the committed libquestdb.dylib, so there is no build step for it
9-
# here (all steps are guarded to skip on Darwin).
8+
# All three platforms are built on their own native runner: Linux (.so),
9+
# Windows (.dll) and macOS (.dylib). None of these binaries are committed.
1010
#
1111
# CMake writes the artifact to:
1212
# core/target/classes/io/questdb/client/bin-local/libquestdb.<ext>
@@ -19,13 +19,13 @@
1919
#
2020
# JAVA_HOME (set to GraalVM JDK 25 by setup.yaml) provides jni.h / jni_md.h:
2121
# - Linux: $JAVA_HOME/include + $JAVA_HOME/include/linux
22+
# - macOS: $JAVA_HOME/include + $JAVA_HOME/include/darwin
2223
# - Windows: %JAVA_HOME%\include + %JAVA_HOME%\include\win32
2324
steps:
2425
- bash: |
2526
set -eux
2627
git submodule update --init --recursive core/src/main/c/share/zstd
2728
displayName: "Init zstd submodule"
28-
condition: ne(variables['Agent.OS'], 'Darwin')
2929
3030
- bash: |
3131
set -eux
@@ -46,6 +46,29 @@ steps:
4646
displayName: "Build native libquestdb.so (Linux x86-64)"
4747
condition: eq(variables['Agent.OS'], 'Linux')
4848
49+
- bash: |
50+
set -eux
51+
command -v cmake >/dev/null 2>&1 || brew install cmake
52+
command -v nasm >/dev/null 2>&1 || brew install nasm
53+
# darwin-aarch64 on Apple silicon agents, darwin-x86-64 on Intel agents.
54+
case "$(uname -m)" in
55+
arm64) platform="darwin-aarch64" ;;
56+
x86_64) platform="darwin-x86-64" ;;
57+
*) echo "unsupported macOS arch: $(uname -m)"; exit 1 ;;
58+
esac
59+
cd core
60+
# Pin the dylib's minimum macOS version so the artifact stays loadable on
61+
# older macOS, matching the release build.
62+
export MACOSX_DEPLOYMENT_TARGET=13.0
63+
cmake -DCMAKE_BUILD_TYPE=Release -B cmake-build-release -S.
64+
cmake --build cmake-build-release --config Release
65+
lib="target/classes/io/questdb/client/bin-local/libquestdb.dylib"
66+
test -f "$lib"
67+
mkdir -p "src/main/resources/io/questdb/client/bin/${platform}"
68+
cp "$lib" "src/main/resources/io/questdb/client/bin/${platform}/libquestdb.dylib"
69+
displayName: "Build native libquestdb.dylib (macOS)"
70+
condition: eq(variables['Agent.OS'], 'Darwin')
71+
4972
- powershell: |
5073
$ErrorActionPreference = "Stop"
5174
# The CMake build is GCC/MinGW based (gcc flags, -static-libgcc/-static-libstdc++),
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)