1
0
forked from Eeveid/lightOps

🐛 fix(release): 修复原生目标构建时的 C 编译器选择

- 仅在 x86_64-unknown-linux-gnu 目标已安装且存在 x86_64-linux-gnu-gcc 时才选择 GNU 交叉目标
- 打包脚本在目标等于当前 Rust host target 时改为原生 cargo build,不再显式传 --target
- 避免 cc-rs 在原生构建场景下错误寻找 x86_64-linux-gnu-gcc 导致发布失败
This commit is contained in:
2026-05-26 10:48:19 +08:00
parent 4322023820
commit 9b63ef38c3
2 changed files with 8 additions and 3 deletions

View File

@@ -85,7 +85,7 @@ jobs:
HOST_TARGET="$(rustc -vV | sed -n 's/^host: //p')"
BUILD_TARGET="$HOST_TARGET"
if [ "$HOST_TARGET" != "x86_64-unknown-linux-gnu" ] && command -v rustup >/dev/null 2>&1; then
if rustup target list --installed | grep -qx 'x86_64-unknown-linux-gnu'; then
if rustup target list --installed | grep -qx 'x86_64-unknown-linux-gnu' && command -v x86_64-linux-gnu-gcc >/dev/null 2>&1; then
BUILD_TARGET="x86_64-unknown-linux-gnu"
fi
fi