Skip to content

Commit 1e3cb7b

Browse files
committed
fix(ci): build linux-aarch64 glibc217 with manylinux2014
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.
1 parent 5b50e61 commit 1e3cb7b

7 files changed

Lines changed: 52 additions & 88 deletions

File tree

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

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,42 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# Build client-cpp for glibc 2.17 baseline (manylinux2014 or CentOS 7 + devtoolset-8).
17+
# Build client-cpp for glibc 2.17 baseline (manylinux2014 x86_64/aarch64, or CentOS 7 fallback).
18+
# Set PACKAGE_CLASSIFIER (e.g. linux-x86_64-glibc217 / linux-aarch64-glibc217).
1819
set -euxo pipefail
1920

21+
MACHINE=$(uname -m)
22+
case "${MACHINE}" in
23+
x86_64)
24+
CMAKE_PKG_ARCH=linux-x86_64
25+
JDK_API_ARCH=linux/x64
26+
;;
27+
aarch64)
28+
CMAKE_PKG_ARCH=linux-aarch64
29+
JDK_API_ARCH=linux/aarch64
30+
;;
31+
*)
32+
echo "Unsupported architecture: ${MACHINE}" >&2
33+
exit 1
34+
;;
35+
esac
36+
37+
if [[ -z "${PACKAGE_CLASSIFIER:-}" ]]; then
38+
if [[ "${MACHINE}" == "x86_64" ]]; then
39+
PACKAGE_CLASSIFIER=linux-x86_64-glibc217
40+
else
41+
PACKAGE_CLASSIFIER=linux-aarch64-glibc217
42+
fi
43+
fi
44+
2045
run_maven_build() {
2146
gcc --version
2247
cmake --version
2348
java -version
2449
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
2550
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
2651
-Dspotless.skip=true \
27-
-Dclient.cpp.package.classifier=linux-x86_64-glibc217
52+
-Dclient.cpp.package.classifier="${PACKAGE_CLASSIFIER}"
2853
}
2954

3055
# CentOS 7 EOL: redirect yum repos to vault.centos.org (see CentOS wiki / SIG SCLo).
@@ -82,7 +107,7 @@ install_centos7_devtoolset8() {
82107
}
83108

84109
if [[ -x /opt/rh/devtoolset-10/root/usr/bin/gcc ]]; then
85-
# manylinux2014_x86_64 ships devtoolset-10 on PATH for glibc 2.17-compatible builds.
110+
# manylinux2014 images ship devtoolset-10 on PATH for glibc 2.17-compatible builds.
86111
yum install -y wget tar which git patch unzip bzip2 || true
87112
else
88113
install_centos7_devtoolset8
@@ -91,18 +116,18 @@ fi
91116
CMAKE_VERSION=3.28.4
92117
CMAKE_DIR=/opt/cmake-${CMAKE_VERSION}
93118
if [[ ! -x "${CMAKE_DIR}/bin/cmake" ]]; then
94-
wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz" \
119+
wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}.tar.gz" \
95120
-O /tmp/cmake.tar.gz
96121
rm -rf "${CMAKE_DIR}"
97122
mkdir -p /opt
98123
tar xf /tmp/cmake.tar.gz -C /opt
99-
mv "/opt/cmake-${CMAKE_VERSION}-linux-x86_64" "${CMAKE_DIR}"
124+
mv "/opt/cmake-${CMAKE_VERSION}-${CMAKE_PKG_ARCH}" "${CMAKE_DIR}"
100125
fi
101126

102127
JAVA_HOME=/opt/jdk-17
103128
if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
104129
wget -qL -O /tmp/jdk17.tar.gz \
105-
"https://api.adoptium.net/v3/binary/latest/17/ga/linux/x64/jdk/hotspot/normal/eclipse?project=jdk"
130+
"https://api.adoptium.net/v3/binary/latest/17/ga/${JDK_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk"
106131
rm -rf /opt/jdk-17*
107132
mkdir -p /opt
108133
tar xf /tmp/jdk17.tar.gz -C /opt
@@ -117,16 +142,16 @@ export JAVA_HOME
117142
if [[ -x /opt/rh/devtoolset-10/root/usr/bin/gcc ]]; then
118143
run_maven_build
119144
else
120-
scl enable devtoolset-8 -- bash -c '
145+
scl enable devtoolset-8 -- bash -c "
121146
set -euxo pipefail
122147
gcc --version
123148
cmake --version
124149
java -version
125-
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
150+
cd \"\${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}\"
126151
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
127152
-Dspotless.skip=true \
128-
-Dclient.cpp.package.classifier=linux-x86_64-glibc217
129-
'
153+
-Dclient.cpp.package.classifier=${PACKAGE_CLASSIFIER}
154+
"
130155
fi
131156

132157
SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"

.github/scripts/package-client-cpp-ubuntu20-arm.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.

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

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,32 +205,33 @@ jobs:
205205
path: ${{ steps.pkg.outputs.path }}
206206
if-no-files-found: error
207207

208-
package-linux-aarch64-glibc231:
209-
name: Package (linux-aarch64-glibc231)
208+
package-linux-aarch64-glibc217:
209+
name: Package (linux-aarch64-glibc217)
210210
needs: [should-package, resolve-matrix]
211211
if: needs.should-package.outputs.run == 'true' && needs.resolve-matrix.outputs.run_linux == 'true'
212+
# Checkout/cache on host; build in manylinux2014 aarch64 via docker run (glibc 2.17 baseline).
212213
runs-on: ubuntu-22.04-arm
213214
steps:
214215
- uses: actions/checkout@v5
215216
- name: Cache Maven packages
216217
uses: actions/cache@v5
217218
with:
218219
path: ~/.m2
219-
key: linux-aarch64-glibc231-m2-${{ hashFiles('**/pom.xml') }}
220+
key: linux-aarch64-glibc217-m2-${{ hashFiles('**/pom.xml') }}
220221
restore-keys: |
221-
linux-aarch64-glibc231-m2-
222-
- name: Package client-cpp (glibc 2.31 baseline)
222+
linux-aarch64-glibc217-m2-
223+
- name: Package client-cpp (glibc 2.17 baseline)
223224
shell: bash
224225
run: |
225226
set -euxo pipefail
226-
chmod +x .github/scripts/package-client-cpp-ubuntu20-arm.sh
227+
chmod +x .github/scripts/package-client-cpp-centos7.sh
227228
docker run --rm \
228-
-v "${{ github.workspace }}:/work" \
229+
-v "${{ github.workspace }}:/workspace" \
229230
-v "${HOME}/.m2:/root/.m2" \
230-
-w /work \
231-
-e GITHUB_WORKSPACE=/work \
232-
ubuntu:20.04 \
233-
bash .github/scripts/package-client-cpp-ubuntu20-arm.sh
231+
-w /workspace \
232+
-e GITHUB_WORKSPACE=/workspace \
233+
quay.io/pypa/manylinux2014_aarch64 \
234+
bash .github/scripts/package-client-cpp-centos7.sh
234235
- name: Restore workspace ownership after container build
235236
if: always()
236237
run: sudo chown -R "$(id -u):$(id -g)" "${{ github.workspace }}"
@@ -240,7 +241,7 @@ jobs:
240241
run: |
241242
set -euo pipefail
242243
shopt -s nullglob
243-
zips=(iotdb-client/client-cpp/target/client-cpp-*-linux-aarch64-glibc231.zip)
244+
zips=(iotdb-client/client-cpp/target/client-cpp-*-linux-aarch64-glibc217.zip)
244245
if [ "${#zips[@]}" -ne 1 ]; then
245246
echo "Expected exactly one package zip, got: ${zips[*]:-(none)}"
246247
exit 1

example/client-cpp-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ publishes one zip per platform/toolchain:
4646
| Deployment target | Classifier suffix |
4747
|-------------------|-------------------|
4848
| Linux x86_64, glibc ≥ 2.17 | `linux-x86_64-glibc217` |
49-
| Linux aarch64, glibc ≥ 2.31 | `linux-aarch64-glibc231` |
49+
| Linux aarch64, glibc ≥ 2.17 | `linux-aarch64-glibc217` |
5050
| macOS x86_64 | `mac-x86_64` |
5151
| macOS arm64 | `mac-aarch64` |
5252
| Windows (match your Visual Studio version) | `windows-x86_64-vs2017``vs2026` |

example/client-cpp-example/README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CI 发版([client-cpp-package.yml](../../.github/workflows/client-cpp-package.
4545
| 目标环境 | classifier 后缀 |
4646
|----------|-----------------|
4747
| Linux x86_64,glibc ≥ 2.17 | `linux-x86_64-glibc217` |
48-
| Linux aarch64,glibc ≥ 2.31 | `linux-aarch64-glibc231` |
48+
| Linux aarch64,glibc ≥ 2.17 | `linux-aarch64-glibc217` |
4949
| macOS x86_64 | `mac-x86_64` |
5050
| macOS arm64 | `mac-aarch64` |
5151
| Windows + 与工程相同的 VS 版本 | `windows-x86_64-vs2017``vs2026` |

iotdb-client/client-cpp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ deployment environment:
8080
| Target environment | Zip classifier (suffix) |
8181
|--------------------|-------------------------|
8282
| Linux x86_64, glibc ≥ 2.17 | `linux-x86_64-glibc217` |
83-
| Linux aarch64, glibc ≥ 2.31 | `linux-aarch64-glibc231` |
83+
| Linux aarch64, glibc ≥ 2.17 | `linux-aarch64-glibc217` |
8484
| macOS x86_64 | `mac-x86_64` |
8585
| macOS arm64 | `mac-aarch64` |
8686
| Windows + Visual Studio 2017 | `windows-x86_64-vs2017` |

iotdb-client/client-cpp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
<os.suffix>win</os.suffix>
259259
</properties>
260260
</profile>
261-
<!-- Visual Studio generators (esp. VS2017) default to Win32 unless -A x64 is set. -->
261+
<!-- Windows: default to x64 (VS2017 and older default to Win32 without -A x64). -->
262262
<profile>
263263
<id>client-cpp-vs-x64</id>
264264
<activation>

0 commit comments

Comments
 (0)