Skip to content

docs: Refer to zigbuild/AL2 #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nmoutschen opened this issue Feb 18, 2022 · 1 comment · Fixed by #428
Closed

docs: Refer to zigbuild/AL2 #422

nmoutschen opened this issue Feb 18, 2022 · 1 comment · Fixed by #428

Comments

@nmoutschen
Copy link
Contributor

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:

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

  1. Mention provided.al2 as the preferred option to deploy Rust functions on AWS Lambda
  2. Mention zigbuild as the preferred option for cross-compilation
  3. Propose zigbuild with $(ARCH)-unknown-linux-gnu.2.17 as the preferred way to compile for AL1 runtimes instead of MUSL
@brysontyrrell
Copy link

Strongly second this. I am using a M1 MacBook Pro and working through the issues that came up trying to compile to x86_64 with @nmoutschen led to the use of zigbuild and working builds I could deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants