Refactor/cpp client sdk#17801
Open
hongzhi-gao wants to merge 38 commits into
Open
Conversation
…arty cache Move C++ client dependency resolution and compilation into one top-level CMakeLists with Fetch* modules, cache tarballs under third-party/<os>/ for offline copy-the-repo workflows, and slim the Maven POM to a CMake wrapper. Skip server CI when only client-cpp changes; gate multi-language-client jobs by language via paths-filter.
Install Homebrew bison on macOS package/IT runners so Thrift 0.21.0 builds (%code requires Bison 2.4+). Add client-cpp-source-build workflow that uses a minimal toolchain and online CMake fetch to verify zero-to-build compilation.
Align Linux/macOS/Windows toolchain setup with client-cpp-package so Spotless clang-format check during mvn package succeeds.
Source-build workflow focuses on minimal-toolchain CMake fetch; pass -Dspotless.skip=true instead of installing clang-format on runners.
Reorganize sources into include/session/rpc with PIMPL so public headers no longer pull in Thrift or Boost. Embed Thrift in iotdb_session on all platforms; on Windows build a /MD shared library with import lib. Update examples, CI verification, and documentation for the slimmer SDK layout.
Fixes Linux CI build where convertToTimestamp/int32ToDate declarations require std::tm from <ctime> (C++11).
Pass CMAKE_POLICY_VERSION_MINIMUM=3.5 when configuring Thrift 0.21 on CMake 4.x (VS2026 CI). Include <cstring> in Session.cpp for memcpy/strlen/strstr on strict Linux builds.
Drop --whole-archive on Linux to avoid libgcc morestack duplicate symbols; build Thrift with -fno-split-stack. Bump default Boost to 1.84.0 for modern Clang on macOS CI.
Linux: keep --whole-archive for Thrift in libiotdb_session.so but add --allow-multiple-definition to avoid libgcc morestack duplicate symbols. macOS: default BOOST_VERSION to 1.84.0 for modern Clang enum checks (other platforms stay on 1.60.0).
Add per-classifier SDK packages (glibc 2.17 on CentOS 7, Windows VS2015-2026), workflow_dispatch variant filter, and documentation for choosing the right zip.
- paths-ignore C++ workflows/scripts on Java IT jobs; narrow C++ path filters (no root pom.xml) - aarch64 package on Ubuntu 20.04 container (linux-aarch64-glibc231) - CentOS7 script: vault repos, Adoptium API JDK, devtoolset deps - VS2015/2017: pin boost-msvc-14.2/14.1 versions instead of missing boost-msvc-14.0
- glibc217/aarch64: checkout on host, build inside docker (fixes CentOS7 + Node 24) - aarch64: install Kitware CMake 3.28 (ARCHIVE_EXTRACT needs 3.18+) - Remove VS2015 package matrix and related docs
- Zip: client-cpp-<version>-<classifier>.zip (remove redundant -cpp- segment) - Root folder client-cpp-<version>-<classifier>/ with include/ and lib/ inside - Update examples (strip one dir on unpack), distribution assembly, CI artifact paths - CentOS7 SCLo vault mirror fix; chown workspace after docker builds
centos-sclo-sclo baseurl with releasever=7 404s on vault; rewrite SCLo repo files and refresh yum cache before devtoolset-8 install.
Replace docker run on ubuntu-22.04 with job-level container quay.io/pypa/manylinux2014_x86_64 and checkout@v4, matching PyPA manylinux CI style.
Job container cannot run Node-based actions on glibc 2.17. Run checkout/cache on ubuntu-latest and build inside manylinux2014 via docker run; use preinstalled devtoolset-10 in the image.
Replace ldd | head -1 with sed -n 1p and find | head -1 with find -quit so glibc checks do not fail after a successful build.
VS2017 generator defaults to Win32; pass -DCMAKE_GENERATOR_PLATFORM=x64 on Windows via Maven profile. Add CI PE check that iotdb_session.dll is x64.
Use manylinux2014_aarch64 and the shared packaging script instead of Ubuntu 20.04 glibc231. Extend the script for aarch64 CMake/JDK arch and classifier auto-detection. Update docs and remove the obsolete ubuntu20-arm script.
Guard checkTemplateExists against a null dataset, document DataIterator lifetime, correct README Maven vs CMake option names, drop unused IotdbResolveTarball.cmake, and skip server CI when only multi-language-client workflow changes.
Rename the Linux packaging helper to a manylinux-specific script, drop unused CentOS7 fallback branches, and keep only build plus GLIBC<=2.17 verification steps. Also add concise C++ workflow comments and unify client-cpp CMake minimum version to 3.15.
Rename public Date type from IoTdbDate to IoTDBDate across headers, RPC/session code, and ITs. Move tests from src/test to a top-level test directory and update CMake, Maven, and README paths accordingly.
Move tree_example.c and table_example.c into client-cpp-example, build them from the shared CMake entry, and update EN/ZH docs. Remove the standalone client-c-example module and drop it from the with-cpp profile.
…linux_2_24 Add linux-*-glibc224 zips built on manylinux_2_24 with -D_GLIBCXX_USE_CXX11_ABI=1 wired through Session and Thrift. Document glibc224 as recommended over glibc217 for modern distros.
Drop client-cpp-source-build.yml; packaging is covered by client-cpp-package.yml.
Resolve sessionIT.cpp include conflict: keep Column.h (upstream column tests) and Date.h (IoTDBDate), drop unused RpcCommon.h.
Fail manylinux package scripts when GLIBC symbols cannot be parsed, and remove stale client-cpp-source-build.yml path triggers left after that workflow was deleted.
Unpack directly to include/ and lib/ at zip root, generate .sha512 via checksum-maven-plugin, and upload checksums from the package workflow.
11 tasks
Maven wget in generate-test-resources; CMake file(DOWNLOAD) fallback; remove test/catch2/catch.hpp from source tree.
Run wget in generate-resources (not generate-test-resources, which runs after compile). CMake also downloads catch.hpp when the header is still missing.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Refactor the C++ Session client packaging/build path to be release-friendly and integrator-friendly: single CMake entry, CI package matrix, flatter SDK zip layout, and checksum artifacts.
1. User-friendly release layout (flattened)
Release zip packages are intentionally minimal and now use a flat root layout:
include/— public IoTDB Session API headers (e.g.Session.h,SessionBuilder.h,SessionC.h,Common.h, ...)lib/— one runtime library:libiotdb_session.solibiotdb_session.dylibiotdb_session.dll+ importiotdb_session.libNot shipped in the package (and not required by SDK consumers):
Package artifact format:
client-cpp-<version>-<classifier>.zipinclude/+lib/at root (no extra nested directory layer)Also added checksum generation:
client-cpp-<version>-<classifier>.zip.sha5122. Ops-friendly CI: package matrix + validation
Release packaging workflow (
client-cpp-package.yml)The workflow builds and uploads one package per target/toolchain (triggered by manual dispatch,
release:published,v*tags, andrc/**with C++ path changes):windows-x86_64-vs2017windows-x86_64-vs2019windows-x86_64-vs2022windows-x86_64-vs2026linux-x86_64-glibc217linux-aarch64-glibc217linux-x86_64-glibc224linux-aarch64-glibc224mac-x86_64mac-aarch64Workflow-level hardening:
.zipand.zip.sha512artifacts together3. Developer-friendly build model
C++ client is driven by a single entry point:
iotdb-client/client-cpp/CMakeLists.txtCMake modules under
cmake/handle dependency/toolchain bootstrap and Thrift source generation. Build output is installed totarget/install, then Maven wraps:Standalone build remains supported:
cmake -S iotdb-client/client-cpp -B build && cmake --build build --target install4. Additional cleanups included
example/client-cpp-example