batuta build
Build the transpiled Rust project into a final binary (Phase 5: Deployment).
Synopsis
batuta build [OPTIONS]
Description
The build command compiles the transpiled Rust project using cargo build. It loads project configuration from batuta.toml to locate the transpiled output directory and any extra cargo flags.
This is Phase 5 of the 5-phase transpilation pipeline. It requires Phase 4 (Validation) to be completed first.
Options
| Option | Description |
|---|---|
--release | Build in release mode (optimized) |
--target <TARGET> | Cross-compile for a specific target platform |
--wasm | Build for WebAssembly (wasm32-unknown-unknown) |
-v, --verbose | Enable verbose output |
-h, --help | Print help |
Configuration
The build command reads settings from batuta.toml:
[transpilation]
output_dir = "./rust-output" # Where to find the transpiled project
[build]
cargo_flags = ["--locked"] # Extra flags passed to cargo build
What It Does
- Loads
batuta.tomlto findtranspilation.output_dir - Verifies
Cargo.tomlexists in the output directory - Builds cargo arguments:
cargo build [--release] [--target <T>] [extra_flags...] - Executes
cargo buildwith inherited stdio (output streams through) - Updates workflow state on success/failure
Examples
Debug Build
$ batuta build
🔨 Building Rust project...
Build Settings:
• Build mode: debug
• WebAssembly: disabled
• Project: ./rust-output
Running: cargo build
Compiling my-project v0.1.0 (/path/to/rust-output)
Finished `dev` profile
✅ Build completed successfully!
Release Build
$ batuta build --release
WebAssembly Build
$ batuta build --wasm --release
Cross-Compilation
$ batuta build --release --target aarch64-unknown-linux-gnu
See Also
Previous: batuta validate
Next: batuta report