# musl linux 交叉编译(Windows 主机无 cc/musl-gcc,用 rust-lld self-contained link) # df-relay 云端部署:本地交叉产 static linux binary → scp 测试机普通运行 # # ⚠️ 默认不要跑交叉编译,产物体积大且会污染 target/ 影响日常 build/rust-analyzer 性能。 # 需要部署 df-relay 时再显式执行,并把产物隔离到独立 target dir: # # CARGO_TARGET_DIR=target-musl cargo build --release --target x86_64-unknown-linux-musl -p df-relay # # 这样 musl 产物落到 target-musl/(已 gitignore),与主 target/ 完全隔离。 [target.x86_64-unknown-linux-musl] linker = "rust-lld" rustflags = ["-C", "link-self-contained=y"]