Prerequisites
Before building, make sure you have the required toolchain and platform build tools installed.
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.
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. Install the C compiler, pkg-config, and OpenSSL development headers for your distribution:# Ubuntu/Debian
sudo apt update && sudo apt install build-essential pkg-config libssl-dev
# Fedora
sudo dnf install gcc gcc-c++ pkg-config openssl-devel
# Arch Linux
sudo pacman -S base-devel pkg-config openssl
Install the Xcode Command Line Tools:This provides clang, make, and the required system libraries.
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:
| Platform | Path |
|---|
| Windows | target\release\prismic_avatar_search.exe |
| Linux | target/release/prismic_avatar_search |
| macOS | target/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.