# 使用 Homebrew, Nix 安装 clang-build-analyzer

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

## 安装

```sh
sudo av install brew:clang-build-analyzer
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install clang-build-analyzer
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#clangbuildanalyzer
```

  证据: nixpkgs package indexes: pkgs/by-name/cl/clangbuildanalyzer/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:clang-build-analyzer
- **软件包管理器:** Homebrew
- **版本:** 1.6.0
- **来源摘要:** Tool to analyze compilation time
- **主页:** <https://github.com/aras-p/ClangBuildAnalyzer>
- **仓库:** <https://github.com/aras-p/ClangBuildAnalyzer>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ClangBuildAnalyzer (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Clang Build Analyzer is a C and C++ build analysis tool that aggregates Clang -ftime-trace JSON files and reports where compilation time is spent. It is a package-nerd tool for people optimizing slow native builds rather than a general application framework.

### 项目历史

The repository was created in August 2019 after Clang 9 introduced -ftime-trace. The README says the tool takes the single-file trace output generated by Clang and aggregates many compilation traces into summaries of slow files, templates, functions, code generation, and expensive headers.

### 采用历史

The supplied package-manager data lists Homebrew and Nix packaging. Release metadata shows an initial 1.0.0 release labeled 'Initial release' and later releases tracking newer Clang support, including Clang 19 support in 1.6.0.

### 使用方式

A typical workflow starts capture with ClangBuildAnalyzer --start, builds with Clang 9 or later using -ftime-trace, stops capture with --stop, and runs --analyze on the produced capture file. A ClangBuildAnalyzer.ini file in the working directory controls how many expensive files, templates, functions, and headers are reported.

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

It matters because it packages a practical workflow around a compiler diagnostic format. For large C++ codebases, it turns a pile of per-object JSON traces into actionable package-maintainer and build-engineer questions: which headers, templates, source files, or compiler phases are costing rebuild time?

### 时间线

- 2019: Repository created after Clang 9 documented -ftime-trace.
- 2020: v1.0.0 initial release published on GitHub.
- 2020: v1.2.0 focused on optimizations for large builds.
- 2023: v1.5.0 improved expensive-header information.
- 2025: v1.6.0 added Clang 19 support and fixes.

### Related projects

- Related projects include Clang, LLVM, Clang's -ftime-trace support, Chrome trace viewers, speedscope.app, and native build systems such as Make, CMake, Xcode, and Visual Studio.

### 来源

- <https://github.com/aras-p/ClangBuildAnalyzer>
- <https://raw.githubusercontent.com/aras-p/ClangBuildAnalyzer/main/readme.md>
- <https://raw.githubusercontent.com/aras-p/ClangBuildAnalyzer/main/ClangBuildAnalyzer.ini>
- <https://api.github.com/repos/aras-p/ClangBuildAnalyzer/releases>
- <https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html>


## 安全说明

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: ./ClangBuildAnalyzer.ini
## 其他软件包管理器记录

- Nix - clangbuildanalyzer: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/cl/clangbuildanalyzer/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/clang-build-analyzer.yml](https://github.com/mxcl/pkgdb/blob/main/combined/clang-build-analyzer.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
