# 使用 Homebrew, apk, apt, dnf, MacPorts, pacman 安装 cbindgen

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

## 安装

```sh
sudo av install brew:cbindgen
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install cbindgen
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cbindgen
```

  证据: MacPorts ports tree: devel/cbindgen/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add cbindgen
```

  证据: Alpine Linux edge package indexes: cbindgen from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install cbindgen
```

  证据: Debian stable package indexes: cbindgen from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install cbindgen
```

  证据: Fedora Rawhide package metadata: cbindgen from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- pacman (92%):

```sh
sudo pacman -S cbindgen
```

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

## 软件包事实

- **软件包键:** brew:cbindgen
- **软件包管理器:** Homebrew
- **版本:** 0.29.4
- **来源摘要:** Project for generating C bindings from Rust code
- **主页:** <https://github.com/mozilla/cbindgen>
- **仓库:** <https://github.com/mozilla/cbindgen>
- **最后更新:** 2026-06-11T00:06:46Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- cbindgen (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

cbindgen is a Mozilla-hosted Rust developer tool that generates C, C++11, and Cython headers for Rust crates exposing a public C API.

### 项目历史

The public Mozilla repository was created in 2017. The official user guide says cbindgen developed largely ad hoc as maintainers added features for their own use cases, with attention to matching Rust's actual layout and ABI guarantees.

### 采用历史

The README lists production users and examples including WebRender, Stylo, maturin, tquic, and metatensor. The supplied package facts show broad packaging across Homebrew, Debian, Ubuntu, Fedora, Arch, Alpine, and MacPorts.

### 使用方式

cbindgen can be run as a standalone CLI or called from a Rust `build.rs`. The quick start requires a Rust crate with a public C API and a `cbindgen.toml` configuration, then emits headers with commands such as `cbindgen --config cbindgen.toml --crate my_rust_library --output my_header.h`.

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

cbindgen sits at a practical packaging boundary: it lets Rust libraries ship C-family headers generated from the Rust source of truth. That makes it important for distributions carrying mixed Rust/C/C++ stacks, especially projects that expose stable FFI surfaces.

### 时间线

- 2017: Public GitHub repository created under Mozilla.
- 2025: 0.28.0 and 0.29.0 releases published on GitHub.
- 2026: 0.29.4 release published on GitHub.

### Related projects

- The README points to production or ecosystem users including WebRender, Stylo, maturin, tquic, and metatensor, and the API documentation is published on docs.rs.

### 来源

- <https://api.github.com/repos/mozilla/cbindgen>
- <https://github.com/mozilla/cbindgen>
- <https://docs.rs/cbindgen>
- <https://github.com/mozilla/cbindgen/blob/main/docs.md>
- <https://github.com/mozilla/cbindgen#readme>
- <https://formulae.brew.sh/api/formula/cbindgen.json>


## 安全说明

narrow executable package without higher-risk signals.

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


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: cbindgen.toml
## 其他软件包管理器记录

- Debian apt - cbindgen - 0.27.0-1+b4: normalized package name match | Debian stable package indexes: cbindgen from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Generates C bindings from Rust code
- Ubuntu apt - cbindgen - 0.26.0-3: normalized package name match | Ubuntu 24.04 LTS package indexes: cbindgen from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Generates C bindings from Rust code
- apk - cbindgen - 0.29.4-r0: normalized package name match | Alpine Linux edge package indexes: cbindgen from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Tool to generate C bindings from Rust code | https://github.com/mozilla/cbindgen
- dnf - cbindgen - 0.29.4-2.fc45: normalized package name match | Fedora Rawhide package metadata: cbindgen from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Tool for generating C bindings to Rust code | https://crates.io/crates/cbindgen
- pacman - cbindgen - 0.29.4-1: normalized package name match | Arch Linux sync databases: cbindgen from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A tool for generating C bindings to Rust code | https://github.com/mozilla/cbindgen
- MacPorts - cbindgen: normalized package name match | MacPorts ports tree: devel/cbindgen/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [cbindgen](https://pkg.so/zh-hans/pkg/cargo/cbindgen/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/cbindgen.yml](https://github.com/mxcl/pkgdb/blob/main/combined/cbindgen.yml)


## 来源

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