Refactor/cpp client sdk#17767
Closed
hongzhi-gao wants to merge 31 commits into
Closed
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.
34dfe07 to
3501aac
Compare
…X11 ABI Publish linux-*-glibc224 zips (cxx11 ABI, glibc >= 2.24) alongside existing glibc217 legacy ABI packages. Harden glibc217 script with explicit ABI=0 and link tests.
Resolve gcc from PATH in manylinux containers; use -Diotdb.extra.cxx.flags so ABI applies to iotdb_session and Thrift. Document Linux zip linking in README.
…8 packages Use manylinux image default gcc/g++ without GLIBCXX macros. glibc228 builds on manylinux_2_28 (glibc max 2.28). Remove IOTDB_EXTRA_CXX_FLAGS wiring.
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: a single CMake entry point, CI release packaging, and a smaller SDK surface for integrators.
1. User-friendly release layout
Release zips are intentionally minimal. Each package contains only what application code needs at link/run time:
include/(e.g.Session.h,SessionBuilder.h,SessionC.h,Common.h, …)libiotdb_session.so/libiotdb_session.dylib/iotdb_session.dll(plus the Windows import.libwhere applicable)Not shipped in the zip (and not required on the consumer side):
Example artifact:
client-cpp-<version>-<classifier>.zip→client-cpp-<version>-<classifier>/{include,lib}.2. Ops-friendly CI: prebuilt packages and source-build checks
Release packaging (
client-cpp-package.yml)New workflow builds one zip per supported platform/toolchain (manual dispatch,
release:published,v*tags, andrc/**when C++ paths change):windows-x86_64-vs2017-A x64/ PE verification in CI)windows-x86_64-vs2019windows-x86_64-vs2022windows-x86_64-vs2026linux-x86_64-glibc217objdumpasserts maxGLIBC_*≤ 2.17linux-aarch64-glibc217mac-x86_64mac-aarch64Deployment guidance (common enterprise Linux):
linux-aarch64-glibc217(built against glibc 2.17; forward-compatible on newer glibc).linux-x86_64-glibc217(same rationale).Not covered by CI packages today (build from source if needed):
Source-build CI (
client-cpp-source-build.yml)Complementary workflow on
master/rc/*(and matching PR paths) verifies that from a clean checkout the client can fetch dependencies and build on:This gives fast feedback that the CMake/third-party bootstrap still works; it does not replace the full release packaging matrix above.
3. Developer-friendly: one CMake entry point
All client logic is driven from a single
iotdb-client/client-cpp/CMakeLists.txt:cmake/modules (FetchBoost,FetchBuildTools,FetchThrift,GenerateThriftSources, optionalFetchOpenSSL)iotdb-protocolIDLiotdb_sessionfromsrc/session/(public API) andsrc/rpc/(internal Thrift layer)src/include/test/(BUILD_TESTING)Maven (
pom.xml) is a thin wrapper:cmakeconfigure → build/install →ctest→ assembly zip. You can also build standalone:cmake -S iotdb-client/client-cpp -B build && cmake --build build --target installOther developer-facing changes:
example/client-cpp-example(removed standaloneexample/client-c-example)README.mdwith layout, classifiers, and local build examples