Skip to main content

System requirements

Before building, make sure you have the following installed:
DependencyVersionPurpose
Rust≥ 1.74Core engine (dpf binary)
Go≥ 1.23FFI bridge and dpf-example
musl-toolsDebian/UbuntuStatic binary builds
FFmpeg6.0+Video and audio operations
Install musl-tools on Debian/Ubuntu:
sudo apt install musl-tools
Install the musl Rust target:
rustup target add x86_64-unknown-linux-musl

Clone the repository

git clone https://github.com/GustavoGutierrez/devpixelforge.git
cd devpixelforge

Build commands

1

Full build (Rust + Go)

Build both the Rust engine and the Go example in one step:
make build
This runs build-rust followed by build-go. The Rust binary lands at dpf/target/release/dpf and the Go example at ./dpf-example.
2

Rust engine only

Build only the Rust binary with the release profile:
make build-rust
Output: dpf/target/release/dpf
3

Static musl binary (Linux)

Build a fully static binary using musl libc — no shared library dependencies:
make build-rust-static
Output: dpf/target/x86_64-unknown-linux-musl/release/dpf
Static builds require musl-tools and the x86_64-unknown-linux-musl Rust target. On macOS, the Makefile automatically selects aarch64-apple-darwin as the target triple instead.
4

Go bridge only

Build the Go example binary (requires the Rust binary to already exist):
make build-go
Output: ./dpf-example
5

Clean build artifacts

Remove all compiled outputs:
make clean
This runs cargo clean inside dpf/, removes dpf-example, and deletes /tmp/bench.

Release profile

The [profile.release] section in dpf/Cargo.toml enables aggressive optimizations: opt-level = 3, lto = "fat", and codegen-units = 1. Fat LTO performs whole-program link-time optimization across all crates, and a single codegen unit allows the compiler to inline and optimize across module boundaries. These settings produce the smallest, fastest binary at the cost of longer compile times.
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
panic = "abort"

Verify the build

After building, confirm the binary is working and inspect its reported capabilities:
./dpf/target/release/dpf caps
A successful run prints the list of supported operations and formats. You can also run a quick one-shot resize to validate the full pipeline:
./dpf/target/release/dpf process \
  --job '{"operation":"resize","input":"image.png","output_dir":"/tmp","widths":[320,640]}'

Build docs developers (and LLMs) love