From 2d9f6eaa988d79cbb84c13b26c3b5d57c5180e75 Mon Sep 17 00:00:00 2001 From: Alexandr Mansurov Date: Wed, 21 Jan 2026 23:47:30 +0100 Subject: [PATCH] Cross-compilation instructions --- Cross.toml | 2 ++ README.md | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Cross.toml diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..925b91c --- /dev/null +++ b/Cross.toml @@ -0,0 +1,2 @@ +[target.x86_64-unknown-linux-gnu] +image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main" diff --git a/README.md b/README.md index 86e8574..c0ae8ad 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,28 @@ cargo fmt 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 MIT