Cross-compilation instructions

This commit is contained in:
2026-01-21 23:47:30 +01:00
parent db8609a248
commit 2d9f6eaa98
2 changed files with 24 additions and 0 deletions

2
Cross.toml Normal file
View File

@@ -0,0 +1,2 @@
[target.x86_64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main"

View File

@@ -115,6 +115,28 @@ cargo fmt
cargo clippy cargo clippy
``` ```
## Cross-Compilation
To build a Linux x86_64 binary from macOS:
1. Install [cargo-zigbuild](https://github.com/rust-cross/cargo-zigbuild) and [Zig](https://ziglang.org/):
```bash
cargo install cargo-zigbuild
brew install zig
```
2. Add the Linux target:
```bash
rustup target add x86_64-unknown-linux-gnu
```
3. Build:
```bash
cargo zigbuild --release --target x86_64-unknown-linux-gnu
```
The binary will be at `target/x86_64-unknown-linux-gnu/release/log_ingest`.
## License ## License
MIT MIT