考虑升级 Rust 工具链版本(rust-lang/rust#157750 导致 macOS 27 冷构建失败) #431
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题原因
本仓库
rust-toolchain.toml固定在 Rust 1.96.0。在 macOS 27(已装 CLT for Xcode 27.0)上做冷构建时,第一批 proc-macro crate 的 dylib 会被链接成畸形 Mach-O,dyld 拒绝加载,rustc 报:这是 Rust 官方已跟踪并修复的上游 bug:
https://github.com/rust-lang/rust/issues/157750
https://github.com/rust-lang/rust/pull/158410
issue 内补充的环境条件:只在用 Xcode 27 链接器(
LC_BUILD_VERSIONSDK ≥ 27.0)链接时出现。本机 2026-09-11 装了 CLT 27.0,正好满足该条件。影响
target/后重建、以及 Jenkins 干净 workspace 的每次构建实测矩阵
复现条件:
--target aarch64-apple-darwin+MACOSX_DEPLOYMENT_TARGET=15.0(Tauri 会从minimumSystemVersion: 15.0自动注入该变量)。最小修复版本为 1.98.x;1.96 / 1.97 均含该缺陷。
补充:
softwareupdate --list显示无可用更新,因此无法通过更新 CLT 规避。打算进行的更改(待确认)
rust-toolchain.toml升级到 1.98.1 —— 直接应用上游修复,开发机与 CI 一并恢复RUSTUP_TOOLCHAIN=1.98.1—— 影响面最小,但本机冷构建仍然失败节点侧:本机已安装 1.98.1(
rustup toolchain list可见),升级后 macOS 构建节点无需额外操作。复现方式(10 秒)
备注:1.96.0 下没有可用的规避手段
已逐个验证无效:
-C strip=none、-C strip=debuginfo、-C debuginfo=0、-Wl,-no_fixup_chains、-Wl,-ld_classic、-fuse-ld=lld(rust 自带ld64.lld)。该修复位于 LLVM 内部,只能通过更换工具链解决。