Skip to main content

Module export

Module export 

Source
Expand description

The exporters export runs (crate::contract::export): one per target, each building the game with the target’s Rust triple and writing its package (Exporter). windows writes a zip, linux a tar.gz, macos a folder holding a signed .app, web a folder and its zip, and playdate a .pdx and its zip. Every package carries NOTICES.txt (notices), and the Windows and macOS ones a note for players on opening an unsigned program (HOW-TO-OPEN.txt).

A --release build has nothing of the build machine: its paths are remapped, and the built binary is searched for them (paths). On Windows and Linux it keeps its line tables in <package>.debug, beside the package and never in it, and the package’s copy is stripped of them with objcopy --strip-debug (which moves no code, so a crash’s offsets name the same lines).

shuyi.ron’s export part names the features a build turns on, never the debug build’s live link (link), and the files and folders copied into the package (ExportCx::copy_beside). A game with no such part gets a build with no feature and a package with nothing else in it.

Every final package is then read back and written down, and held to the game’s disclosure part if it has one (disclosure).

Re-exports§

pub use crate::contract::export::ExportOutput as ExportReport;
pub use crate::contract::export::FileSize;
pub use crate::contract::export::Signing;

Modules§

archive
The archives packages are shipped in: a zip (Windows, the web) and a tar.gz (Linux). Both are written the same for the same files: every entry at one fixed time (1980-01-01), in the order given, so an export made twice gives the same bytes.
disclosure
The last step of every export: the final package read back, after every copy its target makes, and written down in exposure-report.json beside it: each file with its kind, its source, its size and its SHA-256, each file of each pack, the debug file, whatever else is beside it, and what the package was built from.
paths
Nothing of the build machine in a package: the build’s paths remapped to short fixed names (remapped_flags), and the built binary searched for what is left of them (search).
playdate
The Playdate exporter (ADR-0062): the game’s library built as a static library for the device (thumbv7em-none-eabihf) and, on Windows where MinGW is at hand, for the Simulator (x86_64-pc-windows-gnu), linked with the backend’s C shim and the SDK’s setup.c; its pack and its sounds and music (audio) baked beside them, its pdxinfo and launcher images written and NOTICES.txt; all packed by the SDK’s pdc into <base>.pdx, and zipped for sideloading.

Structs§

ExportCx
What an exporter works from.
RunCx
What a run step works from.

Enums§

ExportError
Why an export failed.

Traits§

Exporter
A target’s exporter.

Functions§

exporters
Every exporter.
find
The exporter of target id.
ids
The targets with an exporter.
no_live_link
Refuses a build whose args turn on a feature named link, the debug build’s live link (ADR-0035).