-
lambda-rust-arm64
An AWS Lambda function built to cross compile to arm64 for use with the new Lambda platform.
TL;DR: Rust on ARM64 Lambda: check out my example repo
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
The [[bin]] section allows us to specify the binary filename for what's built (and saves us renaming the file after compilation). The dependencies are all references and dependencies of the AWS Rust runtime crates - that's where the code for the function we'll be using is pulled from.
-
The example that is provided in the AWS Rust runtime repository shows them using a custom linker and rustup target in order to cross-compile for x86-based lambdas. I attempted to dive into how to get a arm64-based linker, but in the process of trying to figure out how to get that linker installed locally (no convenient packages for Ubuntu, sorry), I stumbled across a project that provides cross-compilation tooling for various platforms via Docker. That made my life a lot easier - Using the rust-musl-cross Docker container, all I have to do is wrap the call to cargo build, and it builds for the proper architecture:
Related posts
-
How do I cross compile for Rasperry Pi 64 bit on Windows?
-
Hey Rustaceans! Got a question? Ask here! (36/2022)!
-
Show /r/rust: a Rust implementation of the Realworld demo app spec using Axum and SQLx, written by a co-author of SQLx.
-
Guidance about cross compilation tools, especially targeting musl
-
rust-musl-cross docker images added linux/arm64 architecture support