Container and notes for compiling Rust software for the Steam Frame
Files
README.md

frame-cross #

A container for compiling Rust projects to run natively on the Steam Frame, or in similar aarch64 Linux environments.

Build #

Add RUN lines to Containerfile as needed to install any unusual foreign or build-time dependencies. Runtime data such as shared libraries installed this way will not be available in the Steam Runtime container unless you include them in your package.

Create the container using:

podman build --tag frame-cross .

Run #

Where $WORKSPACE is the cargo workspace you want to build:

podman run --rm -v registry:/root/.cargo/registry -v target:/build/target -v $WORKSPACE:/build/crate -t frame-cross:latest

Append any desired cargo flags to the end of the podman command, e.g. --release --bin client. The contents of the target directory, including any build artifacts, may then be found at the path printed by podman volume inspect target --format '{{.Mountpoint}}'.

If shared libraries will be distributed alongside your binary, you may want to configure the linker to produce a binary with a relative search path, e.g. by adding -C link-args=-Wl,-rpath=$ORIGIN to RUSTFLAGS via the podman --env option. $ORIGIN is literal; take care that it is not expanded by a shell.