This is mirrord's build automation tool, following the Rust xtask pattern.
Build release CLI for your platform:
cargo xtask build-cli --releaseBuilds the complete CLI with all dependencies. This is the main command that orchestrates:
- Building the wizard frontend (npm install + build)
- Building the mirrord layer for the target platform
- Building the mirrord CLI binary
- Creating universal binaries (on macOS)
- Signing binaries (on macOS)
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-wizardSupported platforms:
macos-universal(ormacos,darwin) - macOS universal binary (x86_64 + aarch64)linux-x86_64(orlinux-amd64) - Linux x86_64linux-aarch64(orlinux-arm64) - Linux ARM64windows(orwin) - Windows x86_64
Builds only the wizard frontend.
cargo xtask build-wizardBuilds 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 --releaseThe xtask is organized into modules:
tasks/wizard.rs- Builds the wizard frontend (npm install + build)tasks/layer.rs- Builds mirrord-layer for various platformstasks/cli.rs- Builds mirrord CLI binarytasks/release.rs- Orchestrates the full build process
Each task can be run independently or composed together.
On macOS, the build process:
- Builds layer for both x86_64 and aarch64
- Builds an arm64e shim (for SIP bypass)
- Signs architecture-specific binaries
- Combines them into a universal dylib using
lipo - Builds CLI for both architectures
- Signs architecture-specific CLIs
- Combines into a universal binary
- Signs universal binaries
The xtask automatically detects the environment and uses the appropriate signing method:
CI Environment (when AC_USERNAME and AC_PASSWORD are set):
- Uses
gonwith Apple Developer credentials - Proper code signing and notarization
- Matches the behavior in
.github/workflows/release.yaml
Local Development (when credentials are not set):
- Uses
codesign -f -s -for ad-hoc signing - Fast and suitable for local testing
- No Apple Developer account needed
Note: For CI signing, gon must be installed:
brew tap mitchellh/gon
brew install mitchellh/gon/gonThis xtask workflow is designed to replace the manual build steps in .github/workflows/release.yaml and ./scripts/build_fat_mac.sh. The main advantages:
- Type-safe: Rust compiler ensures correctness
- Composable: Tasks can be run independently or orchestrated
- Cross-platform: Same tool works on all platforms
- Maintainable: All build logic in one place
- Reusable: Can be called from CI or run locally
./scripts/build_fat_mac.sh --release --features wizardcargo xtask build-cli --releaseBoth do the same thing, but xtask:
- Provides better error messages
- Has consistent behavior across platforms
- Is easier to extend with new tasks
- Can be tested like any Rust code