Hacker GitHub

← All repos

rust-cross/cargo-zigbuild

View on GitHub ↗ ★ 2,706 Rust

Compile Cargo project with zig as linker

8 mentions on Hacker News by 8 people: 2 stories, 6 comments · first 2022-02-16 · latest 2025-11-08

Mentions per year 8 mentions · busiest year 2022 (3)
20082026
  1. …or borrow checking). [2] I see people linking Rust programs with Zig's toolchain for this reason: https://github.com/rust-cross/cargo-zigbuild
    comment by scottlamb · 2025-11-08 · in Zig is so cool, C is cooler
  2. You should check out cargo-zigbuild which makes use of zig for cross compiling rust projects. https://github.com/rust-cross/cargo-zigbuild
    comment by tremololo · 2025-11-08 · in Why is Zig so cool?
  3. I use this which seems to work well for my projects. Particularly their docker image. https://github.com/rust-cross/cargo-zigbuild
    comment by cooljacob204 · 2025-03-17 · in That Time I Recreated Photoshop in C++
  4. Interestingly you can use zig within your Rust build to more easily cross-compile: https://github.com/rust-cross/cargo-zigbuild I’m curious what the blockers are for rustc to cross-compile like zig does natively.
  5. …in Rust, and cross-compilation can be a pain when you have a lot of C dependencies. Fortunately https://github.com/messense/cargo-zigbuild exists. It sounds crazy, but using Zig's inbuilt C compiler to help build my Rust projects has been…
    comment by jeffparsons · 2022-10-23 · in C2Rust Transpiler
  6. Have you tried cargo zigbuild? You can target specific GLIBC versions. https://github.com/messense/cargo-zigbuild