-
Notifications
You must be signed in to change notification settings - Fork 379
Closed
Description
At the moment, the documentation recommends using cargo build directly, or running the build in a Docker container which can cause issues based on the platform someone is using. For example:
- https://twitter.com/ShortJared/status/1494564998844239879
- https://twitter.com/bryson3gps/status/1492922934662516743
- Build broken on Apple Silicon computers (and/or Graviton2 builds) aws-samples/serverless-rust-demo#2
Zigbuild is a promising alternative for cargo build for cross-compilation, which works on M1 macs out of the box (while cross doesn't work well on M1 macs).
Why is cross compilation hard for lambda_runtime?
lambda_runtime depends on ring, which uses assembly and thus requires external tools to compile to the target architecture. Setting up those tools depends on the host architecture and can be error-prone.
Proposal
- Mention
provided.al2as the preferred option to deploy Rust functions on AWS Lambda - Mention zigbuild as the preferred option for cross-compilation
- Propose zigbuild with
$(ARCH)-unknown-linux-gnu.2.17as the preferred way to compile for AL1 runtimes instead of MUSL
brysontyrrell, michaelbrewer, CathalMullan, praneetap, calavera and 2 more
Metadata
Metadata
Assignees
Labels
No labels