Skip to content

Commit 128f793

Browse files
committed
fix: ci
1 parent d530905 commit 128f793

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

.github/workflows/CI.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,37 @@ jobs:
338338
image: ${{ steps.docker.outputs.IMAGE }}
339339
options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }}
340340
run: |
341-
if ! echo "${{ steps.docker.outputs.IMAGE }}" | grep -q alpine; then
342-
apt-get update && apt-get install -y libc6-dev build-essential
341+
if echo "${{ steps.docker.outputs.IMAGE }}" | grep -q alpine; then
342+
# Alpine Linux
343+
apk update && apk add --no-cache musl-dev build-base binutils
344+
echo "Checking for le16toh symbol in Alpine..."
345+
if command -v nm >/dev/null 2>&1; then
346+
nm -D /lib/libc.musl-x86_64.so.1 | grep le16toh || echo "le16toh not found in musl libc"
347+
echo "Checking for alternative byte order functions..."
348+
nm -D /lib/libc.musl-x86_64.so.1 | grep -E "(htole16|htons|ntohs)" || echo "No alternative functions found"
349+
else
350+
echo "nm command not available, skipping symbol check"
351+
fi
352+
else
353+
# Debian/Ubuntu
354+
apt-get update && apt-get install -y libc6-dev build-essential binutils curl
355+
echo "Checking for le16toh symbol..."
356+
if command -v nm >/dev/null 2>&1; then
357+
nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep le16toh || echo "le16toh not found in libc"
358+
echo "Checking for alternative byte order functions..."
359+
nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep -E "(htole16|htons|ntohs)" || echo "No alternative functions found"
360+
else
361+
echo "nm command not available, skipping symbol check"
362+
fi
343363
fi
344-
# 检查 le16toh 符号是否可用
345-
echo "Checking for le16toh symbol..."
346-
nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep le16toh || echo "le16toh not found in libc"
347-
# 检查是否有 le16toh 的替代函数
348-
echo "Checking for alternative byte order functions..."
349-
nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep -E "(htole16|htons|ntohs)" || echo "No alternative functions found"
350364
# 设置环境变量确保正确的链接
351365
export RUSTFLAGS="-C link-arg=-Wl,--allow-multiple-definition"
352-
# 清理并重新安装依赖
353-
rm -rf node_modules package-lock.json pnpm-lock.yaml
366+
# 确保 pnpm 可用
367+
if ! command -v pnpm >/dev/null 2>&1; then
368+
echo "Installing pnpm..."
369+
npm install -g pnpm
370+
fi
371+
# 安装依赖
354372
pnpm install --force
355373
npm run test
356374

0 commit comments

Comments
 (0)