GitLab CIで,Rustで作ったプログラムを動かすときにハマったのでまとめます.
GitLab CIで,docker image rust:alpine3.10 を使ってビルドしようとしたら,
error: cannot produce proc-macro for `serde_derive v1.0.104` as the target `x86_64-unknown-linux-musl` does not support these crate types
というエラーが出ました.proc-macro を使うには,target-feature=-crt-static が必要だ*1とかいろいろと情報がありましたが,どれもうまくいかなくて,そういえばalpineだから必要なライブラリがないのかなと思って,普通のやつ (docker image rust:1.40.0) を使ってビルドしたところ,
Compiling serde_derive v1.0.104 ... Finished dev [unoptimized + debuginfo] target(s) in 55.83s
となんの問題もなくビルドが完了しました.proc-macroは普通にmuslでサポートされています.