# 使用 Homebrew, apk, Nix, pacman 安装 cargo-zigbuild

查看 cargo-zigbuild 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

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

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

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

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:cargo-zigbuild
- **软件包管理器:** Homebrew
- **版本:** 0.23.0
- **来源摘要:** Compile Cargo project with zig as linker
- **主页:** <https://github.com/rust-cross/cargo-zigbuild>
- **仓库:** <https://github.com/rust-cross/cargo-zigbuild>
- **最后更新:** 2026-06-18T10:45:13Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cargo-zigbuild (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.23.0
## 项目历史与用法

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

### 项目历史

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

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- <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>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- 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.23.0-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


## 相关链接

- [cargo-zigbuild](https://pkg.so/zh-hans/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/mxcl/pkgdb/blob/main/combined/cargo-zigbuild.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
