1
Fork 0
Build your Rust project, Zig-style.
Find a file
2026-06-14 22:01:45 +02:00
crates don't write to tmp 2026-06-14 15:52:44 +02:00
tools set manifest dir and crate-name 2026-06-12 09:53:24 +02:00
.gitignore This was easy: proc-macro support! 2026-06-10 10:23:33 +02:00
build.zig Document more of what's going on in build.zig 2026-06-14 22:00:18 +02:00
build.zig.zon Minimize metadata 2026-06-14 22:01:45 +02:00
Cargo.lock a dependency which itself uses cc 2026-06-12 13:12:25 +02:00
Cargo.toml No more uniffi patch 2026-06-12 10:06:46 +02:00
LICENSE Add license and readme 2026-06-14 21:33:13 +02:00
README.md Add license and readme 2026-06-14 21:33:13 +02:00

bygge-zig

Build your project Zig-style.

Bygge compiled your project without Cargo. bygge-zig does it with Zig.

Why?

Learn a bit more about Zig, learn a bit more about the Zig build system and get a deeper understanding of what cargo does to build a full Rust project.

What it does

zig build builds a Rust project, as defined by the Cargo.toml around. It works for the example project in this repository. It also works on a checkout of the Glean SDK. It works on macOS and Linux, for all I know.

What it doesn't

<Ctrl-C Ctrl-v>
This is not and never will be an alternative to Cargo.

Cargo is a full-fledged build system, aware of different build targets, allowing to enable features per dependency, easily cross-compile to different targets and run the built programs as well as tests and generate documentation.

zig build ... builds.

Features

  • Builds the example project and the Glean SDK
  • Builds cargo dependencies as listed in a project's Cargo.toml
  • Runs on (at least) macOS and Linux
  • Supports build.rs files
  • Supports proc-macros
  • Non-Rust libraries should work (if they are built in build.rs)

Requirements

  • Rust 1.96.0 (nightly required)
  • Ruby v3+
  • Zig v0.17.0-dev.813+2153f8143 or higher

Use bygge-zig

Copy build.zig, tools/* to your project.

zig build

License

bygge is distributed under the terms of the MIT license.

See LICENSE for details.