Cross-Compilation Guide
Overview
flowchart TB
subgraph dev["Development Machine (macOS)"]
code["Rust Code<br/>(src/agent/)"]
zigbuild["cargo zigbuild<br/>--target x86_64-unknown-linux-gnu"]
binary["target/x86_64-unknown-linux-gnu/<br/>release/spuff-agent<br/>(Linux ELF binary)"]
code --> zigbuild --> binary
end
subgraph vm["Cloud VM (Linux)"]
agent["/opt/spuff/spuff-agent"]
end
binary -->|"SCP / cloud-init"| agentUsing cargo-zigbuild (Recommended)
Install Zig
Install cargo-zigbuild
Cross-Compile
Why zigbuild?
Using Docker (Alternative)
Using cross (Alternative)
Testing the Binary
Check Binary Type
Test on VM
Manual Upload
Build Script
Troubleshooting
Missing Target
Zig Not Found
glibc Version Mismatch
Linking Errors
CI/CD Integration
GitHub Actions
Supported Targets
Target
Architecture
Notes
Building for ARM64
Static Linking (musl)
Last updated
Was this helpful?