Building coopdx-rs from source gives you full control over the binary — debug symbols for development, or a size-optimized release binary for distribution. The project uses a standard Cargo workspace with no custom build scripts; the only external requirement beyond Rust itself is the SDL2 family of system libraries.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/retired64/sm64coopdx_launcher/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before building, make sure you have the following installed on your system.coopdx-rs targets Rust edition 2024, which requires Rust 1.85 or later. Earlier toolchain versions will fail to compile. Run
rustup update stable to update if needed.*-dev packages for your distribution:
- Debian / Ubuntu
- Arch Linux
- Fedora
Build commands
Clone the repository and build with Cargo as usual. There are no code-generation steps or extra setup targets.Release profile settings
The[profile.release] section in Cargo.toml is tuned for a small, fast distribution binary:
| Setting | Value | Effect |
|---|---|---|
opt-level | "z" | Minimizes binary size, accepting slightly slower code than "3" |
lto | true | Enables full link-time optimization across all crates |
strip | true | Removes debug symbols; the output binary contains no DWARF data |
codegen-units | 1 | Forces a single compilation unit, allowing maximum inlining and dead-code elimination |
strip = true means target/release/sm64coopdx-launcher cannot be used with rust-gdb or rust-lldb directly. If you need to debug a release build, temporarily set strip = false and opt-level = 1.Testing and linting
The project ships with a unit test suite covering the gamepad input mapping and other pure functions:Dependencies
All dependencies are declared inCargo.toml. No vendoring or patching is required; cargo build fetches them from crates.io automatically.
| Crate | Version | Purpose |
|---|---|---|
sdl2 | 0.38 | Window, renderer, input, audio — core runtime |
serde + serde_json | 1 | Config serialization (profiles, mod database) |
reqwest | 0.12 (blocking) | HTTP downloads in the mod Download Browser |
zip | 2 | ZIP extraction for downloaded mod archives |
ctrlc | 3 | Graceful Ctrl+C shutdown signal handling |
dirs | 5 | XDG directory resolution (~/.local/share, ~/.config) |
toml | 0.8 | Parsing launcher.toml configuration files |
log + env_logger | 0.4 / 0.11 | Structured logging (set RUST_LOG=debug to enable) |
md5 | 0.7 | ROM file validation (checks the US SM64 baserom MD5) |
The
sdl2 crate is built with four features: image, mixer, ttf, and unsafe_textures. The unsafe_textures feature makes Texture 'static by removing phantom lifetime parameters. This eliminates borrow-checker conflicts between Canvas and Texture during rendering and is the standard production pattern for SDL2 Rust applications — it carries no additional unsafety beyond the underlying C FFI that the crate wraps.