Skip to content

Commit 2877b2d

Browse files
committed
chore(ci): slim manylinux glibc217 package path
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.
1 parent 0b97892 commit 2877b2d

7 files changed

Lines changed: 109 additions & 188 deletions

File tree

.github/scripts/package-client-cpp-centos7.sh

Lines changed: 0 additions & 174 deletions
This file was deleted.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with this
4+
# work for additional information regarding copyright ownership. The ASF
5+
# licenses this file to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance with the
7+
# License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# Build client-cpp in manylinux2014 and verify max required GLIBC symbol <= 2.17.
18+
set -euxo pipefail
19+
20+
MACHINE=$(uname -m)
21+
case "${MACHINE}" in
22+
x86_64)
23+
CMAKE_PKG_ARCH=linux-x86_64
24+
JDK_API_ARCH=linux/x64
25+
DEFAULT_CLASSIFIER=linux-x86_64-glibc217
26+
;;
27+
aarch64)
28+
CMAKE_PKG_ARCH=linux-aarch64
29+
JDK_API_ARCH=linux/aarch64
30+
DEFAULT_CLASSIFIER=linux-aarch64-glibc217
31+
;;
32+
*)
33+
echo "Unsupported architecture: ${MACHINE}" >&2
34+
exit 1
35+
;;
36+
esac
37+
38+
PACKAGE_CLASSIFIER="${PACKAGE_CLASSIFIER:-${DEFAULT_CLASSIFIER}}"
39+
40+
CMAKE_VERSION=3.28.4
41+
CMAKE_DIR="/opt/cmake-${CMAKE_VERSION}"
42+
if [[ ! -x "${CMAKE_DIR}/bin/cmake" ]]; then
43+
wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}.tar.gz" -O /tmp/cmake.tar.gz
44+
rm -rf "${CMAKE_DIR}"
45+
mkdir -p /opt
46+
tar xf /tmp/cmake.tar.gz -C /opt
47+
mv "/opt/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}" "${CMAKE_DIR}"
48+
fi
49+
50+
JAVA_HOME=/opt/jdk-17
51+
if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
52+
wget -qL -O /tmp/jdk17.tar.gz "https://api.adoptium.net/v3/binary/latest/17/ga/${JDK_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk"
53+
rm -rf /opt/jdk-17*
54+
mkdir -p /opt
55+
tar xf /tmp/jdk17.tar.gz -C /opt
56+
JAVA_HOME=$(find /opt -maxdepth 1 -type d -name 'jdk-17*' -print -quit)
57+
ln -sfn "${JAVA_HOME}" /opt/jdk-17
58+
JAVA_HOME=/opt/jdk-17
59+
fi
60+
61+
export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}"
62+
export JAVA_HOME
63+
64+
gcc --version
65+
cmake --version
66+
java -version
67+
68+
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
69+
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
70+
-Dspotless.skip=true \
71+
-Dclient.cpp.package.classifier="${PACKAGE_CLASSIFIER}"
72+
73+
SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"
74+
test -f "${SO}"
75+
76+
echo "=== Build host glibc ==="
77+
ldd --version 2>&1 | sed -n '1p'
78+
79+
echo "=== Highest GLIBC_* symbols in libiotdb_session.so ==="
80+
objdump -T "${SO}" | grep GLIBC_ | sed "s/.*GLIBC_/GLIBC_/" | sort -Vu | tail -10
81+
82+
max_glibc=$(objdump -T "${SO}" | grep -oE "GLIBC_[0-9.]+" | sed "s/GLIBC_//" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)
83+
echo "max_glibc=${max_glibc}"
84+
85+
if awk -v max="${max_glibc}" "BEGIN { exit !(max > 2.17) }"; then
86+
echo "ERROR: libiotdb_session.so requires glibc > 2.17 (max=${max_glibc})"
87+
exit 1
88+
fi
89+
90+
echo "glibc compatibility check passed (max=${max_glibc} <= 2.17)"

.github/workflows/client-cpp-package.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Manual run; Release published; v* tag pushes; rc/** pushes only when C++-related paths change
2-
# (job should-package). release events use the workflow file from the default branch.
3-
#
4-
# Produces per-platform/per-toolchain SDK zips (classifier suffix in artifact name).
1+
# Publish-oriented packaging workflow:
2+
# - manual runs, release:published, v* tags
3+
# - rc/** pushes only when C++-related paths change (job should-package)
4+
# release events always use the workflow file from the default branch.
55
name: C++ Client package
66

77
on:
@@ -39,6 +39,7 @@ env:
3939

4040
jobs:
4141
should-package:
42+
# Keep rc branch cost low: skip full matrix when unrelated files change.
4243
runs-on: ubuntu-latest
4344
outputs:
4445
run: ${{ steps.result.outputs.run }}
@@ -95,6 +96,7 @@ jobs:
9596
windows_matrix: ${{ steps.filter.outputs.windows_matrix }}
9697
steps:
9798
- id: filter
99+
# Resolve workflow_dispatch variants to a compact matrix payload for fromJSON().
98100
shell: bash
99101
run: |
100102
set -euo pipefail
@@ -174,14 +176,14 @@ jobs:
174176
shell: bash
175177
run: |
176178
set -euxo pipefail
177-
chmod +x .github/scripts/package-client-cpp-centos7.sh
179+
chmod +x .github/scripts/package-client-cpp-manylinux-glibc217.sh
178180
docker run --rm \
179181
-v "${{ github.workspace }}:/workspace" \
180182
-v "${HOME}/.m2:/root/.m2" \
181183
-w /workspace \
182184
-e GITHUB_WORKSPACE=/workspace \
183185
quay.io/pypa/manylinux2014_x86_64 \
184-
bash .github/scripts/package-client-cpp-centos7.sh
186+
bash .github/scripts/package-client-cpp-manylinux-glibc217.sh
185187
- name: Restore workspace ownership after container build
186188
if: always()
187189
run: sudo chown -R "$(id -u):$(id -g)" "${{ github.workspace }}"
@@ -224,14 +226,14 @@ jobs:
224226
shell: bash
225227
run: |
226228
set -euxo pipefail
227-
chmod +x .github/scripts/package-client-cpp-centos7.sh
229+
chmod +x .github/scripts/package-client-cpp-manylinux-glibc217.sh
228230
docker run --rm \
229231
-v "${{ github.workspace }}:/workspace" \
230232
-v "${HOME}/.m2:/root/.m2" \
231233
-w /workspace \
232234
-e GITHUB_WORKSPACE=/workspace \
233235
quay.io/pypa/manylinux2014_aarch64 \
234-
bash .github/scripts/package-client-cpp-centos7.sh
236+
bash .github/scripts/package-client-cpp-manylinux-glibc217.sh
235237
- name: Restore workspace ownership after container build
236238
if: always()
237239
run: sudo chown -R "$(id -u):$(id -g)" "${{ github.workspace }}"
@@ -389,6 +391,7 @@ jobs:
389391
fi
390392
"${MVN_ARGS[@]}"
391393
- name: Verify Windows SDK is x64
394+
# Guard against accidental Win32 generator defaults on legacy VS matrices.
392395
shell: pwsh
393396
run: |
394397
$dll = "iotdb-client/client-cpp/target/install/lib/iotdb_session.dll"

.github/workflows/client-cpp-source-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# Verify client-cpp builds from a minimal toolchain: CMake downloads third-party
2-
# sources into third-party/<os>/ and compiles Thrift + iotdb_session without
3-
# pre-installed Boost / flex / bison packages (except where the OS image lacks
4-
# a working compiler or CMake).
1+
# Fast signal workflow for source-build viability.
2+
# Verifies client-cpp can fetch/build dependencies from source on each OS.
3+
# This complements (not replaces) the packaging matrix workflow.
54
name: C++ Client source build
65

76
on:
@@ -105,6 +104,7 @@ jobs:
105104
${{ runner.os }}-${{ runner.arch }}-m2-
106105
107106
- name: Configure and build (CMake fetch, online)
107+
# Keep this job focused on buildability; package workflow validates release classifiers.
108108
shell: bash
109109
env:
110110
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}

.github/workflows/multi-language-client.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Shared client CI: run only affected language jobs via paths-filter.
12
name: Multi-Language Client
23
on:
34
push:
@@ -88,6 +89,7 @@ jobs:
8889
8990
cpp:
9091
needs: changes
92+
# Full client validation (format + server build + verify) for C++ examples and SDK.
9193
if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.cpp == 'true'
9294
strategy:
9395
fail-fast: false

example/client-cpp-example/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
#
1818

19-
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
19+
CMAKE_MINIMUM_REQUIRED(VERSION 3.15)
2020
CMAKE_POLICY(SET CMP0091 NEW)
2121

2222
PROJECT(iotdb_cpp_client_examples)

iotdb-client/client-cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Apache IoTDB - C++ Session Client (top-level CMake build)
2020
# =============================================================================
2121

22-
cmake_minimum_required(VERSION 3.16)
22+
cmake_minimum_required(VERSION 3.15)
2323
project(iotdb_session CXX C)
2424

2525
set(CMAKE_CXX_STANDARD 11)

0 commit comments

Comments
 (0)