Skip to content

Commit 175bbd0

Browse files
committed
refactor(client-cpp): ship SDK tarballs with cmake/pkgconfig and bundled examples
Rename packages to iotdb-session-cpp-* classifiers, move examples into client-cpp, drop glibc2.24 release matrix, and add CI smoke tests that build and run examples against a standalone IoTDB server.
1 parent a52476f commit 175bbd0

37 files changed

Lines changed: 668 additions & 704 deletions

.github/scripts/package-client-cpp-manylinux-glibc217.sh

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ case "${MACHINE}" in
2222
x86_64)
2323
CMAKE_PKG_ARCH=linux-x86_64
2424
JDK_API_ARCH=linux/x64
25-
DEFAULT_CLASSIFIER=linux-x86_64-glibc217
25+
DEFAULT_CLASSIFIER=linux-x86_64-glibc2.17
2626
;;
2727
aarch64)
2828
CMAKE_PKG_ARCH=linux-aarch64
2929
JDK_API_ARCH=linux/aarch64
30-
DEFAULT_CLASSIFIER=linux-aarch64-glibc217
30+
DEFAULT_CLASSIFIER=linux-aarch64-glibc2.17
3131
;;
3232
*)
3333
echo "Unsupported architecture: ${MACHINE}" >&2
@@ -93,3 +93,42 @@ if awk -v max="${max_glibc}" "BEGIN { exit !(max > 2.17) }"; then
9393
fi
9494

9595
echo "glibc compatibility check passed (max=${max_glibc} <= 2.17)"
96+
97+
echo "=== Example package build/link/run smoke test ==="
98+
PKG_TARBALL=$(find "${GITHUB_WORKSPACE}/iotdb-client/client-cpp/target" -maxdepth 1 -type f -name "iotdb-session-cpp-*-${PACKAGE_CLASSIFIER}.tar.gz" -print -quit)
99+
if [[ -z "${PKG_TARBALL}" ]]; then
100+
echo "ERROR: could not find package tarball for ${PACKAGE_CLASSIFIER}"
101+
exit 1
102+
fi
103+
PKG_UNPACK="/tmp/client-cpp-package-smoke-glibc217"
104+
rm -rf "${PKG_UNPACK}"
105+
mkdir -p "${PKG_UNPACK}"
106+
tar -xzf "${PKG_TARBALL}" -C "${PKG_UNPACK}"
107+
PKG_ROOT=$(find "${PKG_UNPACK}" -mindepth 1 -maxdepth 1 -type d -name "iotdb-session-cpp-*-${PACKAGE_CLASSIFIER}" -print -quit)
108+
if [[ -z "${PKG_ROOT}" ]]; then
109+
echo "ERROR: could not find unpacked package directory for ${PACKAGE_CLASSIFIER}"
110+
exit 1
111+
fi
112+
EXAMPLE_BUILD="/tmp/client-cpp-example-smoke-glibc217"
113+
rm -rf "${EXAMPLE_BUILD}"
114+
mkdir -p "${EXAMPLE_BUILD}"
115+
unset CC CXX CFLAGS CXXFLAGS
116+
"${CMAKE_DIR}/bin/cmake" -S "${PKG_ROOT}/examples" -B "${EXAMPLE_BUILD}" \
117+
-DCMAKE_BUILD_TYPE=Release \
118+
-DIOTDB_SDK_ROOT="${PKG_ROOT}"
119+
"${CMAKE_DIR}/bin/cmake" --build "${EXAMPLE_BUILD}" -j"$(nproc)"
120+
121+
./mvnw -pl distribution -am -DskipTests -Dspotless.skip=true package
122+
SERVER_ROOT=$(find "${GITHUB_WORKSPACE}/distribution/target" -path '*/apache-iotdb-*-all-bin/sbin/start-standalone.sh' -print -quit | sed 's#/sbin/start-standalone.sh##')
123+
if [[ -z "${SERVER_ROOT}" ]]; then
124+
echo "ERROR: could not find IoTDB distribution under distribution/target"
125+
exit 1
126+
fi
127+
"${SERVER_ROOT}/sbin/start-standalone.sh"
128+
trap '"${SERVER_ROOT}/sbin/stop-standalone.sh" || true' EXIT
129+
sleep 30
130+
for example in SessionExample AlignedTimeseriesSessionExample TableModelSessionExample tree_example table_example; do
131+
test -x "${EXAMPLE_BUILD}/${example}"
132+
"${EXAMPLE_BUILD}/${example}"
133+
done
134+
echo "Example package smoke test passed"

.github/scripts/package-client-cpp-manylinux-glibc224.sh

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)