# Install cargo-zigbuild with Homebrew, apk, Nix, pacman

Compile Cargo project with zig as linker. Version 0.23.0 via Homebrew; verified 2026-06-18.

## Install

```sh
sudo av install brew:cargo-zigbuild
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cargo-zigbuild
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add cargo-zigbuild
```

  Evidence: Alpine Linux edge package indexes: cargo-zigbuild from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#cargo-zigbuild
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ca/cargo-zigbuild/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S cargo-zigbuild
```

  Evidence: Arch Linux sync databases: cargo-zigbuild from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## Package facts

- **Package key:** brew:cargo-zigbuild
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/cargo-zigbuild>
- **Version:** 0.23.0
- **Source summary:** Compile Cargo project with zig as linker
- **Homepage:** <https://github.com/rust-cross/cargo-zigbuild>
- **Repository:** <https://github.com/rust-cross/cargo-zigbuild>
- **Upstream docs:** <https://docs.rs/cargo-zigbuild>
- **License:** MIT
- **Source archive:** <https://github.com/rust-cross/cargo-zigbuild/archive/refs/tags/v0.23.0.tar.gz>
- **Last updated:** 2026-06-18T10:45:13Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- cargo-zigbuild (cli)
- cargo-zigbuild (alias)

## Dependencies

- zig

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.23.0
- Package-manager updated: 2026-06-18
- Local data: ok
- Upstream repository: https://github.com/rust-cross/cargo-zigbuild
- Upstream latest detected: v0.23.0 (current)
## Project history and usage

cargo-zigbuild is a Cargo subcommand that compiles Rust projects using Zig as the linker to simplify cross compilation.

### Project history

The official README describes cargo-zigbuild as using Zig as linker for easier Rust cross compilation, with cargo, pip, and container installation paths.

### Adoption history

GitHub records the repository as created in February 2022, and crates.io records the first release the same day. The input package facts list Alpine, Homebrew, Nix, and Arch packages, and the README also advertises PyPI and Docker distribution.

### How it is used

The README documents installing Zig, adding Rust targets with rustup, running `cargo zigbuild --target ...`, setting environment variables for Zig/Python/cache paths, targeting glibc versions, and building macOS universal2 binaries.

### Why package nerds care

cargo-zigbuild is significant for package builders because it packages a practical Rust cross-compilation workflow around Zig's linker and libc tooling, reducing the need for bespoke target toolchains.

### Timeline

- 2022: GitHub repository created and first crates.io release recorded.
- 2026: crates.io records max_version 0.23.0.

### Related projects

- The README links Zig, ziglang's PyPI package, Docker images, rustup targets, bindgen, and upstream Zig cross-compilation issues.

### Sources

- <https://api.github.com/repos/rust-cross/cargo-zigbuild>
- <https://github.com/rust-cross/cargo-zigbuild>
- <https://docs.rs/cargo-zigbuild>
- <https://github.com/rust-cross/cargo-zigbuild#readme>
- <https://crates.io/api/v1/crates/cargo-zigbuild>
- <https://formulae.brew.sh/api/formula/cargo-zigbuild.json>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** cargo-zigbuild
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - cargo-zigbuild: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-zigbuild/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - cargo-zigbuild - 0.22.3-r0: normalized package name match | Alpine Linux edge package indexes: cargo-zigbuild from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Compile Cargo project with zig as linker | https://github.com/rust-cross/cargo-zigbuild
- apk - cargo-zigbuild-doc - 0.22.3-r0: normalized package name match | Alpine Linux edge package indexes: cargo-zigbuild-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Compile Cargo project with zig as linker (documentation) | https://github.com/rust-cross/cargo-zigbuild
- pacman - cargo-zigbuild - 0.22.3-1: normalized package name match | Arch Linux sync databases: cargo-zigbuild from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Compile Cargo project with zig as linker | https://github.com/rust-cross/cargo-zigbuild


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Package publisher tools](https://www.automicvault.com/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-generate](https://www.automicvault.com/pkg/brew/cargo-generate/) - Package names and metadata indicate a similar tool family. Shared terms: as, cargo, project.
- [cargo-features-manager](https://www.automicvault.com/pkg/brew/cargo-features-manager/) - Package names and metadata indicate a similar tool family. Shared terms: cargo, project.
- [cargo-zigbuild](https://www.automicvault.com/pkg/cargo/cargo-zigbuild/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/cargo-zigbuild.yml](https://github.com/automic-vault/db/blob/main/combined/cargo-zigbuild.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
