-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Refactor/cpp client sdk #17801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Refactor/cpp client sdk #17801
Changes from 40 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
13802a0
Refactor client-cpp build to single CMake entry with portable third-p…
hongzhi-gao 3e3629d
Fix macOS client-cpp CI bison version and add source-build workflow
hongzhi-gao 7696396
Fix client-cpp-source-build: install clang-format-17 on all runners
hongzhi-gao 1037137
Skip Spotless in client-cpp-source-build; drop clang-format install
hongzhi-gao 2f175f3
Refactor C++ client SDK: isolate Thrift and ship Windows DLL.
hongzhi-gao 27fc230
fix(client-cpp): include ctime for std::tm in Common.h
hongzhi-gao 25e5a48
fix(client-cpp): CMake 4 Thrift policy and Session.cpp cstring
hongzhi-gao 5ce0b02
fix(client-cpp): Linux Thrift link and default Boost 1.84
hongzhi-gao 3864b94
fix(client-cpp): Linux Thrift link and macOS Boost 1.84
hongzhi-gao 75832c9
ci(client-cpp): multi-toolchain package matrix for release zips
hongzhi-gao 26da433
fix(ci): write windows_matrix to GITHUB_OUTPUT without invalid format
hongzhi-gao c58826b
fix(ci): scope C++ triggers, glibc231 arm64, CentOS7 and VS2015 boost
hongzhi-gao 213356a
fix(ci): docker-based glibc builds, CMake 3.28 on arm64, drop VS2015
hongzhi-gao 0238f24
fix(client-cpp): flatten package zip name and layout
hongzhi-gao 776f65a
fix(ci): pin CentOS7 SCLo repos to vault 7.9.2009 for glibc217
hongzhi-gao 6226915
fix(ci): build glibc217 in manylinux2014 job container
hongzhi-gao f633f3b
fix(ci): host checkout + docker manylinux2014 for glibc217
hongzhi-gao 8cacdb1
fix(ci): avoid SIGPIPE 141 from head/tail under pipefail
hongzhi-gao 5b50e61
fix(client-cpp): force x64 for Visual Studio Windows packages
hongzhi-gao 1e3cb7b
fix(ci): build linux-aarch64 glibc217 with manylinux2014
hongzhi-gao 0b97892
fix(client-cpp): PR review follow-ups for SDK branch
hongzhi-gao 2877b2d
chore(ci): slim manylinux glibc217 package path
hongzhi-gao 31438de
refactor(client-cpp): rename IoTDBDate and move tests
hongzhi-gao 252894a
example: merge C Session demos into client-cpp-example
hongzhi-gao a52c9a3
style(client-cpp): apply spotless to C examples
hongzhi-gao f744a14
fix(ci): use curl for downloads in manylinux glibc217 script
hongzhi-gao 30c55e7
fix(ci): use curl directly in manylinux glibc217 script
hongzhi-gao 3501aac
fix(client-cpp): centralize SessionConfig defaults and align fetchSiz…
hongzhi-gao ac4e1fa
ci(client-cpp): add glibc224 packages with explicit CXX11 ABI on many…
hongzhi-gao 569ad3f
fix(client-cpp): correct glibc224 CXX11 ABI check and Maven flag wiring
hongzhi-gao 6eda7b4
fix(client-cpp): use CMake ABI tag file instead of nm for glibc224 CI
hongzhi-gao fe4016d
ci(client-cpp): remove source-build workflow
hongzhi-gao 16f3704
Merge upstream/master into refactor/cpp-client-sdk
hongzhi-gao 275334f
fix(ci): harden glibc checks and drop removed source-build workflow refs
hongzhi-gao bfca828
fix(client-cpp): flatten package zip layout and add SHA512 checksums
hongzhi-gao f89b57f
fix sessionIT.cpp compilation
hongzhi-gao 1ef2640
fix(client-cpp): download Catch2 at build time instead of vendoring
hongzhi-gao 497d8da
fix(client-cpp): download Catch2 before CMake compile phase
hongzhi-gao 2268a0a
feat: integrate cross-module refactors and client-cpp pooling updates
hongzhi-gao a52476f
refactor(client-cpp): move SessionPool implementation into session so…
hongzhi-gao 175bbd0
refactor(client-cpp): ship SDK tarballs with cmake/pkgconfig and bund…
hongzhi-gao 5d9e3af
fix(ci): normalize RUNNER_TEMP for Windows tar extract in cpp package…
hongzhi-gao 6b4c108
chore(client-cpp): trim examples README and formatDatetime dead code
hongzhi-gao 17a26a1
fix(ci): locate Windows standalone scripts under sbin/windows in cpp …
hongzhi-gao 4edd844
fix(ci): start IoTDB on Windows with cmd //c and wait for RPC port 6667
hongzhi-gao a51ace8
fix(ci): upload cpp SDK tarball before packaged example smoke tests
hongzhi-gao fdefd76
refactor(client-cpp): use zip for SDK release packages instead of tar.gz
hongzhi-gao b43d1e1
fix(ci): correct Git Bash quoting when starting IoTDB on Windows
hongzhi-gao aa46a2f
fix(ci): build packaged examples as x64 for VS2017 on Windows
hongzhi-gao 9e00d43
Improve C++ session package documentation
hongzhi-gao 6a71c1b
Set CXX11 ABI for glibc217 C++ package
hongzhi-gao 520fac6
Fix C++ SDK CXX11 ABI propagation
hongzhi-gao 77d41e9
Fix C++ SDK package ABI verification
hongzhi-gao 3eb2624
Fix glibc217 C++ client ABI build
hongzhi-gao dafbbf9
Use link test for glibc217 C++ ABI check
hongzhi-gao b75fa82
Rebuild C++ client when ABI changes
hongzhi-gao 468a2d9
Fail C++ client build on ABI mismatch
hongzhi-gao 5a709e8
Use old libstdc++ ABI for glibc217 package
hongzhi-gao 97cdd82
Use manylinux_2_28 for C++ client packages
hongzhi-gao 8320f8e
chore(ci): remove unused local Windows C++ example debug scripts
hongzhi-gao 6ed2b82
Fix MSVC debug C++ client build
hongzhi-gao 4187837
Document C++ client debug builds
hongzhi-gao 4fb0ce0
Address C++ client packaging review comments
hongzhi-gao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| #!/usr/bin/env bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with this | ||
| # work for additional information regarding copyright ownership. The ASF | ||
| # licenses this file to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance with the | ||
| # License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # Build client-cpp in manylinux2014 and verify max required GLIBC symbol <= 2.17. | ||
| set -euxo pipefail | ||
|
|
||
| MACHINE=$(uname -m) | ||
| case "${MACHINE}" in | ||
| x86_64) | ||
| CMAKE_PKG_ARCH=linux-x86_64 | ||
| JDK_API_ARCH=linux/x64 | ||
| DEFAULT_CLASSIFIER=linux-x86_64-glibc217 | ||
| ;; | ||
| aarch64) | ||
| CMAKE_PKG_ARCH=linux-aarch64 | ||
| JDK_API_ARCH=linux/aarch64 | ||
| DEFAULT_CLASSIFIER=linux-aarch64-glibc217 | ||
| ;; | ||
| *) | ||
| echo "Unsupported architecture: ${MACHINE}" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| PACKAGE_CLASSIFIER="${PACKAGE_CLASSIFIER:-${DEFAULT_CLASSIFIER}}" | ||
|
|
||
| CMAKE_VERSION=3.28.4 | ||
| CMAKE_DIR="/opt/cmake-${CMAKE_VERSION}" | ||
| if [[ ! -x "${CMAKE_DIR}/bin/cmake" ]]; then | ||
| curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}.tar.gz" | ||
| rm -rf "${CMAKE_DIR}" | ||
| mkdir -p /opt | ||
| tar xf /tmp/cmake.tar.gz -C /opt | ||
| mv "/opt/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}" "${CMAKE_DIR}" | ||
| fi | ||
|
|
||
| JAVA_HOME=/opt/jdk-17 | ||
| if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then | ||
| curl -fsSL -o /tmp/jdk17.tar.gz "https://api.adoptium.net/v3/binary/latest/17/ga/${JDK_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk" | ||
| rm -rf /opt/jdk-17* | ||
| mkdir -p /opt | ||
| tar xf /tmp/jdk17.tar.gz -C /opt | ||
| JAVA_HOME=$(find /opt -maxdepth 1 -type d -name 'jdk-17*' -print -quit) | ||
| ln -sfn "${JAVA_HOME}" /opt/jdk-17 | ||
| JAVA_HOME=/opt/jdk-17 | ||
| fi | ||
|
|
||
| export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}" | ||
| export JAVA_HOME | ||
|
|
||
| gcc --version | ||
| cmake --version | ||
| java -version | ||
|
|
||
| cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}" | ||
| ./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \ | ||
| -Dspotless.skip=true \ | ||
| -Dclient.cpp.package.classifier="${PACKAGE_CLASSIFIER}" | ||
|
|
||
| SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so" | ||
| test -f "${SO}" | ||
|
|
||
| echo "=== Build host glibc ===" | ||
| ldd --version 2>&1 | sed -n '1p' | ||
|
|
||
| echo "=== Highest GLIBC_* symbols in libiotdb_session.so ===" | ||
| objdump -T "${SO}" | grep GLIBC_ | sed "s/.*GLIBC_/GLIBC_/" | sort -Vu | tail -10 | ||
|
|
||
| max_glibc=$(objdump -T "${SO}" | grep -oE "GLIBC_[0-9.]+" | sed "s/GLIBC_//" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1) | ||
| echo "max_glibc=${max_glibc}" | ||
|
|
||
| if [[ -z "${max_glibc}" ]]; then | ||
| echo "ERROR: could not determine max GLIBC version from ${SO}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if awk -v max="${max_glibc}" "BEGIN { exit !(max > 2.17) }"; then | ||
| echo "ERROR: libiotdb_session.so requires glibc > 2.17 (max=${max_glibc})" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "glibc compatibility check passed (max=${max_glibc} <= 2.17)" |
129 changes: 129 additions & 0 deletions
129
.github/scripts/package-client-cpp-manylinux-glibc224.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| #!/usr/bin/env bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with this | ||
| # work for additional information regarding copyright ownership. The ASF | ||
| # licenses this file to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance with the | ||
| # License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| # manylinux_2_24 baseline; explicit CXX11 libstdc++ ABI; max glibc 2.24. | ||
| set -euxo pipefail | ||
|
|
||
| MAX_GLIBC=2.24 | ||
|
|
||
| MACHINE=$(uname -m) | ||
| case "${MACHINE}" in | ||
| x86_64) | ||
| CMAKE_PKG_ARCH=linux-x86_64 | ||
| JDK_API_ARCH=linux/x64 | ||
| DEFAULT_CLASSIFIER=linux-x86_64-glibc224 | ||
| ;; | ||
| aarch64) | ||
| CMAKE_PKG_ARCH=linux-aarch64 | ||
| JDK_API_ARCH=linux/aarch64 | ||
| DEFAULT_CLASSIFIER=linux-aarch64-glibc224 | ||
| ;; | ||
| *) | ||
| echo "Unsupported architecture: ${MACHINE}" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| PACKAGE_CLASSIFIER="${PACKAGE_CLASSIFIER:-${DEFAULT_CLASSIFIER}}" | ||
|
|
||
| CMAKE_VERSION=3.28.4 | ||
| CMAKE_DIR="/opt/cmake-${CMAKE_VERSION}" | ||
| if [[ ! -x "${CMAKE_DIR}/bin/cmake" ]]; then | ||
| curl -fsSL -o /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}.tar.gz" | ||
| rm -rf "${CMAKE_DIR}" | ||
| mkdir -p /opt | ||
| tar xf /tmp/cmake.tar.gz -C /opt | ||
| mv "/opt/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}" "${CMAKE_DIR}" | ||
| fi | ||
|
|
||
| JAVA_HOME=/opt/jdk-17 | ||
| if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then | ||
| curl -fsSL -o /tmp/jdk17.tar.gz "https://api.adoptium.net/v3/binary/latest/17/ga/${JDK_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk" | ||
| rm -rf /opt/jdk-17* | ||
| mkdir -p /opt | ||
| tar xf /tmp/jdk17.tar.gz -C /opt | ||
| JAVA_HOME=$(find /opt -maxdepth 1 -type d -name 'jdk-17*' -print -quit) | ||
| ln -sfn "${JAVA_HOME}" /opt/jdk-17 | ||
| JAVA_HOME=/opt/jdk-17 | ||
| fi | ||
|
|
||
| export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}" | ||
| export JAVA_HOME | ||
|
|
||
| echo "=== Toolchain ===" | ||
| command -v gcc g++ || true | ||
| gcc --version | head -1 | ||
| g++ --version | head -1 | ||
| g++ -dM -E -x c++ /dev/null | grep GLIBCXX_USE_CXX11_ABI || true | ||
| cmake --version | ||
| java -version | ||
|
|
||
| cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}" | ||
| ./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \ | ||
| -Dspotless.skip=true \ | ||
| -Dclient.cpp.package.classifier="${PACKAGE_CLASSIFIER}" \ | ||
| -Diotdb.libstdcxx.cxx11.abi=ON | ||
|
|
||
| SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so" | ||
| test -f "${SO}" | ||
|
|
||
| echo "=== libstdc++ ABI check (cxx11) ===" | ||
| ABI_TAG="${GITHUB_WORKSPACE}/iotdb-client/client-cpp/target/build/iotdb_libstdcxx_abi_tag" | ||
| if [[ ! -f "${ABI_TAG}" ]]; then | ||
| echo "ERROR: missing CMake ABI tag file ${ABI_TAG}" | ||
| exit 1 | ||
| fi | ||
| ABI_TAG_VALUE=$(tr -d '[:space:]' < "${ABI_TAG}") | ||
| if [[ "${ABI_TAG_VALUE}" != "cxx11" ]]; then | ||
| echo "ERROR: expected iotdb_libstdcxx_abi_tag=cxx11, got '${ABI_TAG_VALUE}'" | ||
| exit 1 | ||
| fi | ||
| echo "ABI check passed (cmake tag=${ABI_TAG_VALUE})" | ||
|
|
||
| echo "=== Build host glibc ===" | ||
| ldd --version 2>&1 | sed -n '1p' | ||
|
|
||
| echo "=== Highest GLIBC_* symbols in libiotdb_session.so ===" | ||
| objdump -T "${SO}" | grep GLIBC_ | sed "s/.*GLIBC_/GLIBC_/" | sort -Vu | tail -10 | ||
|
|
||
| max_glibc=$(objdump -T "${SO}" | grep -oE "GLIBC_[0-9.]+" | sed "s/GLIBC_//" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1) | ||
| echo "max_glibc=${max_glibc}" | ||
|
|
||
| if [[ -z "${max_glibc}" ]]; then | ||
| echo "ERROR: could not determine max GLIBC version from ${SO}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if awk -v max="${max_glibc}" -v limit="${MAX_GLIBC}" 'BEGIN { exit !(max > limit) }'; then | ||
| echo "ERROR: libiotdb_session.so requires glibc > ${MAX_GLIBC} (max=${max_glibc})" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "glibc compatibility check passed (max=${max_glibc} <= ${MAX_GLIBC})" | ||
|
|
||
| echo "=== Example link test (default g++) ===" | ||
| INSTALL_ROOT="${GITHUB_WORKSPACE}/iotdb-client/client-cpp/target/install" | ||
| EXAMPLE_SRC="${GITHUB_WORKSPACE}/example/client-cpp-example/src" | ||
| LINKTEST_BUILD="/tmp/client-cpp-example-linktest-glibc224" | ||
| rm -rf "${LINKTEST_BUILD}" | ||
| mkdir -p "${LINKTEST_BUILD}" | ||
| unset CC CXX CFLAGS CXXFLAGS | ||
| "${CMAKE_DIR}/bin/cmake" -S "${EXAMPLE_SRC}" -B "${LINKTEST_BUILD}" \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DIOTDB_SDK_ROOT="${INSTALL_ROOT}" | ||
| "${CMAKE_DIR}/bin/cmake" --build "${LINKTEST_BUILD}" --target SessionExample -j"$(nproc)" | ||
| test -x "${LINKTEST_BUILD}/SessionExample" | ||
| echo "Example link test passed" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.