Cross Compiling Rust lambdas for Netlify Functions is fairly straightforward using rust-toolchain
and .cargo/config
.
[toolchain]channel = "stable"components = ["rustfmt", "clippy"]targets = ["x86_64-unknown-linux-musl"]
as
[target.x86_64-unknown-linux-musl]linker = "x86_64-linux-musl-gcc"
You will also need the following. gcc
and
brew install FiloSottile/musl-cross/musl-crossbrew install gccln -s /usr/local/bin/x86_64-linux-musl-gcc /usr/local/bin/musl-gcc
Or you could use ed25519-dalek which is rust-native and skips these problems.