Skip to content

Commit 8cacdb1

Browse files
committed
fix(ci): avoid SIGPIPE 141 from head/tail under pipefail
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.
1 parent f633f3b commit 8cacdb1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if [[ ! -x "${JAVA_HOME}/bin/java" ]]; then
106106
rm -rf /opt/jdk-17*
107107
mkdir -p /opt
108108
tar xf /tmp/jdk17.tar.gz -C /opt
109-
JAVA_HOME=$(find /opt -maxdepth 1 -type d -name 'jdk-17*' | head -1)
109+
JAVA_HOME=$(find /opt -maxdepth 1 -type d -name 'jdk-17*' -print -quit)
110110
ln -sfn "${JAVA_HOME}" /opt/jdk-17
111111
JAVA_HOME=/opt/jdk-17
112112
fi
@@ -133,7 +133,7 @@ SO="iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"
133133
test -f "${SO}"
134134

135135
echo "=== Build host glibc ==="
136-
ldd --version | head -1
136+
ldd --version 2>&1 | sed -n '1p'
137137

138138
echo "=== Highest GLIBC_* symbols in libiotdb_session.so ==="
139139
objdump -T "${SO}" | grep GLIBC_ | sed "s/.*GLIBC_/GLIBC_/" | sort -Vu | tail -10

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}"
4141
java -version
4242
gcc --version
4343
cmake --version
44-
ldd --version | head -1
44+
ldd --version 2>&1 | sed -n '1p'
4545

4646
cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
4747
./mvnw clean package -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \

0 commit comments

Comments
 (0)