# System map — BurntSushi/ripgrep

> Canonical page: https://codevetter.com/unpack/ripgrep/system-map

# System map — BurntSushi/ripgrep

Scanned commit 3fce3b5bb0236da2df6d99672afb8a719642eca7 (2026-08-04). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

The workspace root `Cargo.toml` declares the `ripgrep` package producing one binary `rg` from `crates/core/main.rs`, and lists ten workspace members under `crates/`. `crates/core` is not published as a library — it is pure glue plus the CLI definition, as its README states. Dependencies flow strictly downward: core → `grep` facade → `grep-searcher`/`grep-printer`/`grep-regex`/`grep-pcre2`/`grep-cli`/`grep-matcher`, with `ignore` and `globset` used for traversal and glob filtering. There is no network, database or server component in the default build; the only external integrations are subprocesses (decompressors, `--pre` preprocessor, hostname binary) and, under `unstable-index`, a redb embedded database on disk. Deployment is static binaries cross-compiled for ~14 targets by a tag-triggered GitHub Actions release workflow, plus a Debian package described by `[package.metadata.deb]`.
- The single binary target `rg` is declared in the root manifest with `path = "crates/core/main.rs"`, and `autotests = false` with one explicit `[[test]] name = "integration", path = "tests/tests.rs"`. — [Cargo.toml#L26-L37](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/Cargo.toml#L26-L37)
- `fn main() -> ExitCode` calls `run(flags::parse())` and dispatches on `args.mode()` into seven arms: indexed search, single-threaded `search`, `search_parallel`, `index::write`, `files`/`files_parallel`, `types`, and `generate`. — [crates/core/main.rs#L43-L105](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/main.rs#L43-L105)
- The workspace has ten members — `globset`, `grep`, `cli`, `index`, `matcher`, `pcre2`, `printer`, `regex`, `searcher`, `ignore` — sharing `edition = "2024"` and `rust-version = "1.96"` via `[workspace.package]`. — [Cargo.toml#L39-L57](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/Cargo.toml#L39-L57)
- `crates/grep` is a pure facade that re-exports the constituent crates as `grep::cli`, `grep::matcher`, `grep::printer`, `grep::regex`, `grep::searcher` and (feature-gated) `grep::pcre2`. — [crates/grep/src/lib.rs#L15-L21](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/grep/src/lib.rs#L15-L21) [crates/grep/Cargo.toml](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/grep/Cargo.toml)
- The published crate names differ from directory names: `crates/matcher` is `grep-matcher` v0.1.9, `crates/printer` is `grep-printer` v0.3.1, `crates/searcher` is `grep-searcher` v0.1.17, `crates/regex` is `grep-regex` v0.1.14. — [crates/matcher/Cargo.toml#L1-L3](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/matcher/Cargo.toml#L1-L3) [crates/printer/Cargo.toml#L1-L3](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/printer/Cargo.toml#L1-L3) [crates/searcher/Cargo.toml#L1-L3](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/searcher/Cargo.toml#L1-L3) [crates/regex/Cargo.toml#L1-L3](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/regex/Cargo.toml#L1-L3)
- There is no persistent storage in the default build; the only storage layer is the optional `grep-index` crate, which opens a redb `Database`/`ReadOnlyDatabase` at a file named `index.db` inside a discovered `.ripgrep` directory. — [crates/index/src/index.rs#L7-L30](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/index/src/index.rs#L7-L30) [crates/index/Cargo.toml#L20-L25](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/index/Cargo.toml#L20-L25)
- `grep-index` is marked `publish = false`, version `0.0.1`, and is wired in only through the `unstable-index` Cargo feature (`dep:grep-index`), which the root manifest itself warns "may have very serious bugs". — [crates/index/Cargo.toml#L1-L4](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/index/Cargo.toml#L1-L4) [Cargo.toml#L83-L87](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/Cargo.toml#L83-L87)
- Index code is compiled behind a `#[path]` module swap: `crates/core/index/mod.rs` selects `disabled.rs` (which `bail!`s "indexing not enabled in this build") or `enabled.rs` based on the `unstable-index` feature. — [crates/core/index/mod.rs#L1-L8](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/index/mod.rs#L1-L8) [crates/core/index/disabled.rs](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/index/disabled.rs) [crates/core/index/enabled.rs](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/index/enabled.rs)
- `build.rs` embeds the short git hash as `RIPGREP_BUILD_GIT_HASH` by shelling out to `git rev-parse --short=10 HEAD`, and on `windows`+`msvc` embeds `pkg/windows/Manifest.xml` via `/MANIFEST:EMBED` linker args to enable long paths. — [build.rs#L1-L33](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/build.rs#L1-L33) [build.rs#L34-L60](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/build.rs#L34-L60)
- Build/test commands are `cargo build --release` (optionally `--features pcre2`) and `cargo test --all`; CI additionally runs `cargo test --workspace --features unstable-index` and `cargo fmt --all --check`. — [README.md#L451-L516](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/README.md#L451-L516) [.github/workflows/ci.yml#L155-L180](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/.github/workflows/ci.yml#L155-L180) [.github/workflows/ci.yml#L215-L225](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/.github/workflows/ci.yml#L215-L225)
- On musl 64-bit targets the binary swaps in jemalloc as the `#[global_allocator]` because musl's allocator measurably slows ripgrep down; this is the only allocator override. — [crates/core/main.rs#L18-L41](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/crates/core/main.rs#L18-L41) [Cargo.toml#L76-L78](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/Cargo.toml#L76-L78)
- Release shape: a `release-lto` profile (fat LTO, `panic = "abort"`, `codegen-units = 1`, symbols stripped) plus `.cargo/config.toml` forcing `+crt-static` for MSVC and musl targets so shipped binaries are statically linked. — [Cargo.toml#L91-L104](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/Cargo.toml#L91-L104) [.cargo/config.toml](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/.cargo/config.toml)
- The release workflow triggers only on `[0-9]+.[0-9]+.[0-9]+` tags, verifies the tag matches the `version = "..."` line in `Cargo.toml`, and fans out over ~14 targets including aarch64/armv7/s390x/powerpc64 Linux, macOS x86_64+arm64 and four Windows targets. — [.github/workflows/release.yml#L1-L45](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/.github/workflows/release.yml#L1-L45) [.github/workflows/release.yml#L64-L140](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/.github/workflows/release.yml#L64-L140)
- Packaging metadata installs `rg`, licenses, CHANGELOG/README/FAQ, plus a generated man page and bash/fish/zsh completions from `deployment/deb/` — artifacts that do not exist in the repo and must be produced by `ci/build-deb`. — [Cargo.toml#L106-L128](https://github.com/BurntSushi/ripgrep/blob/3fce3b5bb0236da2df6d99672afb8a719642eca7/Cargo.toml#L106-L128)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
