Closed
Description
Problem
On a musl based linux system , cross compilation will fail when using proc-macro
Steps
1.Cargo.toml:
[package]
name = "demo"
version = "0.1.0"
edition = "2018"
[dependencies]
serde= { version = "1.0", features = ["derive"] }
2.src/main.rs:
fn main(){}
$ RUSTFLAGS="-C target-feature=-crt-static" cargo build --target=wasm32-wasi
error: cannot produce proc-macro for `serde_derive v1.0.102` as the target `x86_64-unknown-linux-musl` does not support these crate types
Possible Solution(s)
Problem is : https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/build_context/target_info.rs#L406
proc-macro can't build without RUSTFLAGS=-C target-feature=-crt-static
Notes
Output of cargo version
: cargo 1.40.0-nightly (5da4b4d47 2019-10-28)