Skip to main content

Prerequisites

Before building, make sure you have the required toolchain and platform build tools installed.

Rust toolchain

Install Rust via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Rustup installs rustc, cargo, and the standard library. It also manages toolchain updates.

Platform build tools

Install Visual Studio Build Tools with the C++ build tools component:
winget install Microsoft.VisualStudio.2022.BuildTools
Alternatively, install Visual Studio Community and select the Desktop development with C++ workload during setup.

Build commands

Run all commands from the prismic_avatar_search/ directory.
# Release build (recommended for use)
cargo build --release

# Development build (faster compile, less optimization)
cargo build

# Build and run immediately
cargo run --release
cargo run
Release builds are significantly faster at runtime. The development build skips most compiler optimizations, so the resulting binary can be noticeably slower for CPU-intensive operations like searching and database processing.

Output binary location

After a successful build, the compiled binary is placed in the target/ directory:
PlatformPath
Windowstarget\release\prismic_avatar_search.exe
Linuxtarget/release/prismic_avatar_search
macOStarget/release/prismic_avatar_search
The binary is self-contained. No runtime dependencies need to be installed separately — all libraries are statically linked or bundled during compilation.

Toolchain maintenance

rustup update   # update the Rust compiler and standard library
cargo clean     # clear the build cache (forces a full rebuild)
Run rustup update periodically to stay on the latest stable release. Run cargo clean if you encounter stale build artifacts causing unexpected errors.

Debug logging

Set the RUST_LOG environment variable to enable verbose logging:
# Linux/macOS
RUST_LOG=debug cargo run --release
export RUST_LOG=debug  # persist for the session

# Windows (Command Prompt)
set RUST_LOG=debug
cargo run --release

# Windows (PowerShell)
$env:RUST_LOG = "debug"
cargo run --release
Log output is written to stderr and includes HTTP requests, file operations, and worker thread messages.

Build docs developers (and LLMs) love