xtask/README.md
This is mirrord's build automation tool, following the Rust xtask pattern.
Build release CLI for your platform:
cargo xtask build-cli --release
build-cliBuilds the complete CLI with all dependencies. This is the main command that orchestrates:
Usage:
# Debug build for current platform (auto-detected)
cargo xtask build-cli
# Release build
cargo xtask build-cli --release
# Build for specific platform
cargo xtask build-cli --release --platform macos-universal
cargo xtask build-cli --release --platform linux-x86_64
cargo xtask build-cli --release --platform linux-aarch64
cargo xtask build-cli --release --platform windows
# Build without wizard frontend
cargo xtask build-cli --release --no-wizard
# Build without monitor frontend
cargo xtask build-cli --release --no-monitor
# Build with the wizard feature but reuse an existing dist directory
cargo xtask build-cli --release --skip-build-wizard
Supported platforms:
macos-universal (or macos, darwin) - macOS universal binary (x86_64 + aarch64)linux-x86_64 (or linux-amd64) - Linux x86_64linux-aarch64 (or linux-arm64) - Linux ARM64windows (or win) - Windows x86_64build-wizardBuilds and packages the wizard frontend assets required by the CLI build.
cargo xtask build-wizard
build-monitorPrepares the monitor frontend assets required by the CLI build.
cargo xtask build-monitor
build-layerBuilds only the mirrord layer.
# Debug build for current platform
cargo xtask build-layer
# Release build for specific platform
cargo xtask build-layer --platform macos-universal --release
cargo xtask build-layer --platform linux-x86_64 --release
# Quick debug build for testing
cargo xtask build-cli
# Full release build
cargo xtask build-cli --release
# Linux x86_64
cargo xtask build-cli --release --platform linux-x86_64
# Linux ARM64 (requires cross-compilation setup)
cargo xtask build-cli --release --platform linux-aarch64
# Build wizard only
cargo xtask build-wizard
# Build layer only
cargo xtask build-layer --release
# Build full CLI (builds wizard + layer + CLI)
cargo xtask build-cli --release
The xtask is organized into modules:
tasks/wizard.rs - Builds the wizard frontend (npm install + build)tasks/monitor.rs - Prepares the monitor frontend assetstasks/layer.rs - Builds mirrord-layer for various platformstasks/cli.rs - Builds mirrord CLI binarytasks/release.rs - Orchestrates the full build processEach task can be run independently or composed together.
On macOS, the build process:
lipoThe xtask automatically detects the environment and uses the appropriate signing method:
CI Environment (when AC_USERNAME and AC_PASSWORD are set):
gon with Apple Developer credentials.github/workflows/release.yamlLocal Development (when credentials are not set):
codesign -f -s - for ad-hoc signingNote: For CI signing, gon must be installed:
brew tap mitchellh/gon
brew install mitchellh/gon/gon
This xtask workflow is designed to replace the manual build steps in .github/workflows/release.yaml and ./scripts/build_fat_mac.sh. The main advantages:
./scripts/build_fat_mac.sh --release --features wizard
cargo xtask build-cli --release
Both do the same thing, but xtask: