Skip to content

Commit 6eda7b4

Browse files
committed
fix(client-cpp): use CMake ABI tag file instead of nm for glibc224 CI
1 parent 569ad3f commit 6eda7b4

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

.github/scripts/package-client-cpp-manylinux-glibc224.sh

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,18 @@ cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
8080
SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"
8181
test -f "${SO}"
8282

83-
echo "=== libstdc++ ABI check (cxx11: mangled names must contain __cxx11) ==="
84-
# Use mangled symbol names: "nm -C" demangles std::__cxx11::basic_string to std::string
85-
# and hides __cxx11 even when the library was built with the new ABI.
86-
_abi_has_cxx11() {
87-
nm -a "$1" 2>/dev/null | grep -q '__cxx11'
88-
}
89-
if _abi_has_cxx11 "${SO}"; then
90-
echo "ABI check passed (__cxx11 in ${SO})"
91-
else
92-
SESSION_OBJ=$(find "${GITHUB_WORKSPACE}/iotdb-client/client-cpp/target" \
93-
-path '*/iotdb_session.dir/src/session/Session.cpp.o' -print -quit 2>/dev/null || true)
94-
if [[ -n "${SESSION_OBJ}" ]] && _abi_has_cxx11 "${SESSION_OBJ}"; then
95-
echo "ABI check passed (__cxx11 in ${SESSION_OBJ}; .so has minimal symbol table)"
96-
else
97-
echo "ERROR: cxx11 ABI build must contain __cxx11 symbols in ${SO} (or Session.cpp.o)"
98-
exit 1
99-
fi
83+
echo "=== libstdc++ ABI check (cxx11) ==="
84+
ABI_TAG="${GITHUB_WORKSPACE}/iotdb-client/client-cpp/target/build/iotdb_libstdcxx_abi_tag"
85+
if [[ ! -f "${ABI_TAG}" ]]; then
86+
echo "ERROR: missing CMake ABI tag file ${ABI_TAG}"
87+
exit 1
88+
fi
89+
ABI_TAG_VALUE=$(tr -d '[:space:]' < "${ABI_TAG}")
90+
if [[ "${ABI_TAG_VALUE}" != "cxx11" ]]; then
91+
echo "ERROR: expected iotdb_libstdcxx_abi_tag=cxx11, got '${ABI_TAG_VALUE}'"
92+
exit 1
10093
fi
94+
echo "ABI check passed (cmake tag=${ABI_TAG_VALUE})"
10195

10296
echo "=== Build host glibc ==="
10397
ldd --version 2>&1 | sed -n '1p'

iotdb-client/client-cpp/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ if(NOT MSVC)
4646
if(IOTDB_EXTRA_CXX_FLAGS)
4747
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IOTDB_EXTRA_CXX_FLAGS}")
4848
endif()
49+
# CI/release scripts read this tag; nm-based checks are unreliable on some toolchains.
50+
if(IOTDB_LIBSTDCXX_CXX11_ABI)
51+
file(WRITE "${CMAKE_BINARY_DIR}/iotdb_libstdcxx_abi_tag" "cxx11\n")
52+
else()
53+
file(WRITE "${CMAKE_BINARY_DIR}/iotdb_libstdcxx_abi_tag" "legacy\n")
54+
endif()
4955
endif()
5056

5157
if(MSVC)

0 commit comments

Comments
 (0)