fix: Alpine 使用可用的静态库包名称
Some checks failed
Build and Release Mond / build-and-test (arm64, ubuntu) (push) Successful in 40s
Build and Release Mond / build-and-test (amd64, ubuntu) (push) Successful in 54s
Build and Release Mond / build-and-test (arm64, alpine) (push) Failing after 1m3s
Build and Release Mond / build-and-test (amd64, alpine) (push) Failing after 1m10s
Build and Release Mond / release (push) Has been skipped

问题:Alpine 3.18 缺少这些静态包:
- hidapi-static
- libusb-static
- zeromq-static
- expat-static

解决方案:
- 保留存在的 -static 包:boost-static, openssl-libs-static, libsodium-static, libunwind-static, readline-static
- 使用 -dev 包替代不存在的 -static 包:zeromq-dev, hidapi-dev, libusb-dev, expat-dev
- 依靠 CMake 强制标志优先使用 .a 文件:
  * CMAKE_FIND_LIBRARY_SUFFIXES=".a"
  * CMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++"
This commit is contained in:
2025-12-15 14:28:32 +08:00
parent f509d1934d
commit 202c36f21e

View File

@@ -3,7 +3,7 @@ FROM alpine:3.18 AS base
ARG TARGETARCH ARG TARGETARCH
ARG BUILDPLATFORM ARG BUILDPLATFORM
# 安装构建依赖(静态库版本 # 安装构建依赖(包含静态库的 -dev 包
RUN apk add --no-cache \ RUN apk add --no-cache \
git \ git \
wget \ wget \
@@ -11,14 +11,15 @@ RUN apk add --no-cache \
cmake \ cmake \
boost-static \ boost-static \
openssl-libs-static \ openssl-libs-static \
zeromq-static \ openssl-dev \
zeromq-dev \
libsodium-static \ libsodium-static \
libunwind-static \ libunwind-static \
xz-dev \ xz-dev \
readline-static \ readline-static \
expat-static \ expat-dev \
hidapi-static \ hidapi-dev \
libusb-static \ libusb-dev \
protobuf-dev \ protobuf-dev \
eudev-dev \ eudev-dev \
linux-headers \ linux-headers \