Skip to content

docs: Refer to zigbuild/AL2 #422

@nmoutschen

Description

@nmoutschen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions