Skip to content

Commit c58826b

Browse files
committed
fix(ci): scope C++ triggers, glibc231 arm64, CentOS7 and VS2015 boost
- 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
1 parent 26da433 commit c58826b

18 files changed

Lines changed: 183 additions & 54 deletions

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@
1818
set -euxo pipefail
1919

2020
# CentOS 7 EOL: use vault mirrors when default mirrors are unavailable.
21-
if grep -q mirrorlist /etc/yum.repos.d/CentOS-*.repo 2>/dev/null; then
22-
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo
23-
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo
24-
fi
21+
for repo in /etc/yum.repos.d/CentOS-*.repo; do
22+
if [[ -f "${repo}" ]] && grep -q '^mirrorlist=' "${repo}"; then
23+
sed -i 's/^mirrorlist=/#mirrorlist=/g' "${repo}"
24+
sed -i 's|^#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' "${repo}"
25+
fi
26+
done
2527

26-
yum install -y centos-release-scl epel-release
28+
yum install -y ca-certificates centos-release-scl epel-release
2729
yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils \
28-
make wget tar which git patch unzip
30+
devtoolset-8-libstdc++-devel scl-utils \
31+
make wget tar which git patch unzip bzip2
2932

3033
CMAKE_VERSION=3.28.4
3134
CMAKE_DIR=/opt/cmake-${CMAKE_VERSION}
@@ -40,12 +43,14 @@ fi
4043

4144
JAVA_HOME=/opt/jdk-17
4245
if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
43-
wget -q "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz" \
44-
-O /tmp/jdk17.tar.gz
45-
rm -rf "${JAVA_HOME}"
46+
wget -qL -O /tmp/jdk17.tar.gz \
47+
"https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk"
48+
rm -rf /opt/jdk-17*
4649
mkdir -p /opt
4750
tar xf /tmp/jdk17.tar.gz -C /opt
48-
mv /opt/jdk-17.0.13+11 "${JAVA_HOME}"
51+
JAVA_HOME=$(find /opt -maxdepth 1 -type d -name 'jdk-17*' | head -1)
52+
ln -sfn "${JAVA_HOME}" /opt/jdk-17
53+
JAVA_HOME=/opt/jdk-17
4954
fi
5055

5156
export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}"
@@ -74,7 +79,6 @@ objdump -T "${SO}" | grep GLIBC_ | sed "s/.*GLIBC_/GLIBC_/" | sort -Vu | tail -1
7479
max_glibc=$(objdump -T "${SO}" | grep -oE "GLIBC_[0-9.]+" | sed "s/GLIBC_//" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)
7580
echo "max_glibc=${max_glibc}"
7681

77-
# Fail if any symbol requires glibc newer than 2.17
7882
if awk -v max="${max_glibc}" "BEGIN { exit !(max > 2.17) }"; then
7983
echo "ERROR: libiotdb_session.so requires glibc > 2.17 (max=${max_glibc})"
8084
exit 1
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 on Ubuntu 20.04 aarch64 (glibc 2.31 baseline).
18+
set -euxo pipefail
19+
20+
export DEBIAN_FRONTEND=noninteractive
21+
apt-get update
22+
apt-get install -y build-essential cmake wget git ca-certificates \
23+
openjdk-17-jdk binutils
24+
25+
JAVA_BIN=$(readlink -f "$(command -v java)")
26+
export JAVA_HOME=$(dirname "$(dirname "${JAVA_BIN}")")
27+
export PATH="${JAVA_HOME}/bin:${PATH}"
28+
29+
java -version
30+
gcc --version
31+
cmake --version
32+
ldd --version | head -1
33+
34+
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
35+
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
36+
-Dspotless.skip=true \
37+
-Dclient.cpp.package.classifier=linux-aarch64-glibc231
38+
39+
SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"
40+
test -f "${SO}"
41+
42+
max_glibc=$(objdump -T "${SO}" | grep -oE "GLIBC_[0-9.]+" | sed "s/GLIBC_//" | sort -t. -k1,1n -k2,2n -k3,3n | tail -1)
43+
echo "max_glibc=${max_glibc}"
44+
45+
if awk -v max="${max_glibc}" "BEGIN { exit !(max > 2.31) }"; then
46+
echo "ERROR: libiotdb_session.so requires glibc > 2.31 (max=${max_glibc})"
47+
exit 1
48+
fi
49+
50+
echo "glibc compatibility check passed (max=${max_glibc} <= 2.31)"

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

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,15 @@ jobs:
5252
with:
5353
filters: |
5454
cpp:
55-
- 'pom.xml'
56-
- 'iotdb-client/**'
57-
- 'iotdb-protocol/**'
55+
- 'iotdb-client/client-cpp/**'
56+
- 'iotdb-client/pom.xml'
57+
- 'example/client-cpp-example/**'
58+
- 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift'
59+
- 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift'
5860
- '.github/workflows/client-cpp-package.yml'
61+
- '.github/workflows/client-cpp-source-build.yml'
62+
- '.github/scripts/package-client-cpp-*.sh'
63+
- '.github/scripts/package-client-cpp-*.sh'
5964
- id: result
6065
shell: bash
6166
run: |
@@ -123,7 +128,7 @@ jobs:
123128
echo "run_windows=${run_windows}" >> "$GITHUB_OUTPUT"
124129
125130
# Compact JSON (no leading whitespace); required for GITHUB_OUTPUT + fromJSON().
126-
WINDOWS_MATRIX='[{"name":"windows-vs2026","runs-on":"windows-2025-vs2026","boost_choco":"boost-msvc-14.3","cmake_generator":"Visual Studio 18 2026","package_classifier":"windows-x86_64-vs2026","vs_choco":"","vs_choco_params":"","continue_on_error":false},{"name":"windows-vs2022","runs-on":"windows-2022","boost_choco":"boost-msvc-14.3","cmake_generator":"","package_classifier":"windows-x86_64-vs2022","vs_choco":"","vs_choco_params":"","continue_on_error":false},{"name":"windows-vs2019","runs-on":"windows-2022","boost_choco":"boost-msvc-14.2","cmake_generator":"Visual Studio 16 2019","package_classifier":"windows-x86_64-vs2019","vs_choco":"visualstudio2019buildtools","vs_choco_params":"--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended","continue_on_error":false},{"name":"windows-vs2017","runs-on":"windows-2022","boost_choco":"boost-msvc-14.1","cmake_generator":"Visual Studio 15 2017","package_classifier":"windows-x86_64-vs2017","vs_choco":"visualstudio2017buildtools","vs_choco_params":"--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended","continue_on_error":false},{"name":"windows-vs2015","runs-on":"windows-2022","boost_choco":"boost-msvc-14.0","cmake_generator":"Visual Studio 14 2015","package_classifier":"windows-x86_64-vs2015","vs_choco":"visualstudio2015buildtools","vs_choco_params":"","continue_on_error":true}]'
131+
WINDOWS_MATRIX='[{"name":"windows-vs2026","runs-on":"windows-2025-vs2026","boost_choco":"boost-msvc-14.3","boost_choco_version":"","cmake_generator":"Visual Studio 18 2026","package_classifier":"windows-x86_64-vs2026","vs_choco":"","vs_choco_params":"","continue_on_error":false},{"name":"windows-vs2022","runs-on":"windows-2022","boost_choco":"boost-msvc-14.3","boost_choco_version":"","cmake_generator":"","package_classifier":"windows-x86_64-vs2022","vs_choco":"","vs_choco_params":"","continue_on_error":false},{"name":"windows-vs2019","runs-on":"windows-2022","boost_choco":"boost-msvc-14.2","boost_choco_version":"","cmake_generator":"Visual Studio 16 2019","package_classifier":"windows-x86_64-vs2019","vs_choco":"visualstudio2019buildtools","vs_choco_params":"--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended","continue_on_error":false},{"name":"windows-vs2017","runs-on":"windows-2022","boost_choco":"boost-msvc-14.1","boost_choco_version":"1.74.0","cmake_generator":"Visual Studio 15 2017","package_classifier":"windows-x86_64-vs2017","vs_choco":"visualstudio2017buildtools","vs_choco_params":"--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended","continue_on_error":false},{"name":"windows-vs2015","runs-on":"windows-2022","boost_choco":"boost-msvc-14.2","boost_choco_version":"1.67.0","cmake_generator":"Visual Studio 14 2015","package_classifier":"windows-x86_64-vs2015","vs_choco":"visualstudio2015buildtools","vs_choco_params":"","continue_on_error":true}]'
127132
128133
write_windows_matrix_output() {
129134
local matrix_json="$1"
@@ -181,42 +186,33 @@ jobs:
181186
path: iotdb-client/client-cpp/target/client-cpp-*-cpp-linux-x86_64-glibc217.zip
182187
if-no-files-found: error
183188

184-
package-linux-aarch64:
185-
name: Package (linux-aarch64)
189+
package-linux-aarch64-glibc231:
190+
name: Package (linux-aarch64-glibc231)
186191
needs: [should-package, resolve-matrix]
187192
if: needs.should-package.outputs.run == 'true' && needs.resolve-matrix.outputs.run_linux == 'true'
188193
runs-on: ubuntu-22.04-arm
194+
container:
195+
image: ubuntu:20.04
189196
steps:
190197
- uses: actions/checkout@v5
191-
- name: Set up JDK 17
192-
uses: actions/setup-java@v5
193-
with:
194-
distribution: temurin
195-
java-version: "17"
196-
- name: Install C++ dependencies (Linux aarch64)
197-
shell: bash
198-
run: |
199-
set -euxo pipefail
200-
sudo apt-get update
201-
sudo apt-get install -y libboost-all-dev openssl libssl-dev wget
202198
- name: Cache Maven packages
203199
uses: actions/cache@v5
204200
with:
205201
path: ~/.m2
206-
key: linux-aarch64-m2-${{ hashFiles('**/pom.xml') }}
202+
key: linux-aarch64-glibc231-m2-${{ hashFiles('**/pom.xml') }}
207203
restore-keys: |
208-
linux-aarch64-m2-
209-
- name: Package client-cpp
204+
linux-aarch64-glibc231-m2-
205+
- name: Package client-cpp (glibc 2.31 baseline)
210206
shell: bash
211207
run: |
212208
set -euxo pipefail
213-
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
214-
-Dspotless.skip=true
209+
chmod +x .github/scripts/package-client-cpp-ubuntu20-arm.sh
210+
.github/scripts/package-client-cpp-ubuntu20-arm.sh
215211
- name: Upload zip artifact
216212
uses: actions/upload-artifact@v6
217213
with:
218-
name: client-cpp-linux-aarch64
219-
path: iotdb-client/client-cpp/target/client-cpp-*-cpp-linux-aarch64.zip
214+
name: client-cpp-linux-aarch64-glibc231
215+
path: iotdb-client/client-cpp/target/client-cpp-*-cpp-linux-aarch64-glibc231.zip
220216
if-no-files-found: error
221217

222218
package-macos:
@@ -302,9 +298,19 @@ jobs:
302298
shell: pwsh
303299
run: |
304300
choco install winflexbison3 -y --no-progress
305-
choco install ${{ matrix.boost_choco }} -y --no-progress
306-
$boost_path = (Get-ChildItem -Path 'C:\local\' -Filter 'boost_*').FullName
307-
echo $boost_path >> $env:GITHUB_PATH
301+
$boostArgs = @('install', '${{ matrix.boost_choco }}', '-y', '--no-progress')
302+
if ('${{ matrix.boost_choco_version }}' -ne '') {
303+
$boostArgs += @("--version=${{ matrix.boost_choco_version }}")
304+
}
305+
& choco @boostArgs
306+
if (-not (Test-Path 'C:\local')) {
307+
New-Item -ItemType Directory -Path 'C:\local' -Force | Out-Null
308+
}
309+
$boostDir = Get-ChildItem -Path 'C:\local\' -Filter 'boost_*' -ErrorAction SilentlyContinue | Select-Object -First 1
310+
if (-not $boostDir) {
311+
throw "Boost not found under C:\local after installing ${{ matrix.boost_choco }}"
312+
}
313+
echo $boostDir.FullName >> $env:GITHUB_PATH
308314
choco install openssl -y --no-progress
309315
$sslPath = (Get-ChildItem 'C:\Program Files\OpenSSL*' -Directory | Select-Object -First 1).FullName
310316
echo "$sslPath\bin" >> $env:GITHUB_PATH

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,28 @@ on:
1010
- master
1111
- "rc/*"
1212
paths:
13-
- "pom.xml"
1413
- "iotdb-client/pom.xml"
1514
- "iotdb-client/client-cpp/**"
15+
- "example/client-cpp-example/**"
1616
- "iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift"
1717
- "iotdb-protocol/thrift-commons/src/main/thrift/common.thrift"
1818
- ".github/workflows/client-cpp-source-build.yml"
19+
- ".github/workflows/client-cpp-package.yml"
20+
- ".github/scripts/package-client-cpp-*.sh"
1921
pull_request:
2022
branches:
2123
- master
2224
- "rc/*"
2325
- "force_ci/**"
2426
paths:
25-
- "pom.xml"
2627
- "iotdb-client/pom.xml"
2728
- "iotdb-client/client-cpp/**"
29+
- "example/client-cpp-example/**"
2830
- "iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift"
2931
- "iotdb-protocol/thrift-commons/src/main/thrift/common.thrift"
3032
- ".github/workflows/client-cpp-source-build.yml"
33+
- ".github/workflows/client-cpp-package.yml"
34+
- ".github/scripts/package-client-cpp-*.sh"
3135
workflow_dispatch:
3236

3337
concurrency:

.github/workflows/cluster-it-1c1d.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- "site/**"
1212
- "iotdb-client/client-cpp/**"
1313
- "example/client-cpp-example/**"
14+
- ".github/workflows/client-cpp-package.yml"
15+
- ".github/workflows/client-cpp-source-build.yml"
16+
- ".github/scripts/package-client-cpp-*.sh"
1417
pull_request:
1518
branches:
1619
- master
@@ -21,6 +24,9 @@ on:
2124
- "site/**"
2225
- "iotdb-client/client-cpp/**"
2326
- "example/client-cpp-example/**"
27+
- ".github/workflows/client-cpp-package.yml"
28+
- ".github/workflows/client-cpp-source-build.yml"
29+
- ".github/scripts/package-client-cpp-*.sh"
2430
# allow manually run the action:
2531
workflow_dispatch:
2632

.github/workflows/cluster-it-1c1d1a.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- 'site/**'
1212
- 'iotdb-client/client-cpp/**'
1313
- 'example/client-cpp-example/**'
14+
- '.github/workflows/client-cpp-package.yml'
15+
- '.github/workflows/client-cpp-source-build.yml'
16+
- '.github/scripts/package-client-cpp-*.sh'
1417
pull_request:
1518
branches:
1619
- master
@@ -22,6 +25,9 @@ on:
2225
- 'site/**'
2326
- 'iotdb-client/client-cpp/**'
2427
- 'example/client-cpp-example/**'
28+
- '.github/workflows/client-cpp-package.yml'
29+
- '.github/workflows/client-cpp-source-build.yml'
30+
- '.github/scripts/package-client-cpp-*.sh'
2531
# allow manually run the action:
2632
workflow_dispatch:
2733

.github/workflows/cluster-it-1c3d.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- "site/**"
1212
- "iotdb-client/client-cpp/**"
1313
- "example/client-cpp-example/**"
14+
- ".github/workflows/client-cpp-package.yml"
15+
- ".github/workflows/client-cpp-source-build.yml"
16+
- ".github/scripts/package-client-cpp-*.sh"
1417
pull_request:
1518
branches:
1619
- master
@@ -22,6 +25,9 @@ on:
2225
- "site/**"
2326
- "iotdb-client/client-cpp/**"
2427
- "example/client-cpp-example/**"
28+
- ".github/workflows/client-cpp-package.yml"
29+
- ".github/workflows/client-cpp-source-build.yml"
30+
- ".github/scripts/package-client-cpp-*.sh"
2531
# allow manually run the action:
2632
workflow_dispatch:
2733

.github/workflows/compile-check.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- "site/**"
1414
- "iotdb-client/client-cpp/**"
1515
- "example/client-cpp-example/**"
16+
- ".github/workflows/client-cpp-package.yml"
17+
- ".github/workflows/client-cpp-source-build.yml"
18+
- ".github/scripts/package-client-cpp-*.sh"
1619
pull_request:
1720
branches:
1821
- master
@@ -24,6 +27,9 @@ on:
2427
- "site/**"
2528
- "iotdb-client/client-cpp/**"
2629
- "example/client-cpp-example/**"
30+
- ".github/workflows/client-cpp-package.yml"
31+
- ".github/workflows/client-cpp-source-build.yml"
32+
- ".github/scripts/package-client-cpp-*.sh"
2733
# allow manually run the action:
2834
workflow_dispatch:
2935

.github/workflows/dependency-check.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- "site/**"
1414
- "iotdb-client/client-cpp/**"
1515
- "example/client-cpp-example/**"
16+
- ".github/workflows/client-cpp-package.yml"
17+
- ".github/workflows/client-cpp-source-build.yml"
18+
- ".github/scripts/package-client-cpp-*.sh"
1619
pull_request:
1720
branches:
1821
- master
@@ -24,6 +27,9 @@ on:
2427
- "site/**"
2528
- "iotdb-client/client-cpp/**"
2629
- "example/client-cpp-example/**"
30+
- ".github/workflows/client-cpp-package.yml"
31+
- ".github/workflows/client-cpp-source-build.yml"
32+
- ".github/scripts/package-client-cpp-*.sh"
2733
# allow manually run the action:
2834
workflow_dispatch:
2935

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,32 @@ on:
55
- master
66
- "rc/*"
77
paths:
8-
- 'pom.xml'
98
- 'iotdb-client/pom.xml'
109
- 'iotdb-client/client-py/**'
1110
- 'iotdb-client/client-cpp/**'
1211
- 'example/client-cpp-example/**'
1312
- 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift'
1413
- 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift'
1514
- '.github/workflows/multi-language-client.yml'
15+
- '.github/workflows/client-cpp-source-build.yml'
16+
- '.github/workflows/client-cpp-package.yml'
17+
- '.github/scripts/package-client-cpp-*.sh'
1618
pull_request:
1719
branches:
1820
- master
1921
- "rc/*"
2022
- 'force_ci/**'
2123
paths:
22-
- 'pom.xml'
2324
- 'iotdb-client/pom.xml'
2425
- 'iotdb-client/client-py/**'
2526
- 'iotdb-client/client-cpp/**'
2627
- 'example/client-cpp-example/**'
2728
- 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift'
2829
- 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift'
2930
- '.github/workflows/multi-language-client.yml'
31+
- '.github/workflows/client-cpp-source-build.yml'
32+
- '.github/workflows/client-cpp-package.yml'
33+
- '.github/scripts/package-client-cpp-*.sh'
3034
# allow manually run the action:
3135
workflow_dispatch:
3236

@@ -54,14 +58,15 @@ jobs:
5458
with:
5559
filters: |
5660
cpp:
57-
- 'pom.xml'
5861
- 'iotdb-client/pom.xml'
5962
- 'iotdb-client/client-cpp/**'
6063
- 'example/client-cpp-example/**'
6164
- 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift'
6265
- 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift'
6366
- '.github/workflows/multi-language-client.yml'
6467
- '.github/workflows/client-cpp-source-build.yml'
68+
- '.github/workflows/client-cpp-package.yml'
69+
- '.github/scripts/package-client-cpp-*.sh'
6570
python:
6671
- 'pom.xml'
6772
- 'iotdb-client/pom.xml'

0 commit comments

Comments
 (0)