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

Cargo subcommand to provide options for testing and continuous integration. Version 0.6.45 via Homebrew; verified 2026-05-30.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cargo-hack
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add cargo-hack
```

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

- Nix (92%):

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

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

- pacman (92%):

```sh
sudo pacman -S cargo-hack
```

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

## Package facts

- **Package key:** brew:cargo-hack
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/cargo-hack>
- **Version:** 0.6.45
- **Source summary:** Cargo subcommand to provide options for testing and continuous integration
- **Homepage:** <https://github.com/taiki-e/cargo-hack>
- **Repository:** <https://github.com/taiki-e/cargo-hack>
- **Upstream docs:** <https://github.com/taiki-e/cargo-hack#readme>
- **License:** Apache-2.0 OR MIT
- **Source archive:** <https://github.com/taiki-e/cargo-hack/archive/refs/tags/v0.6.45.tar.gz>
- **Last updated:** 2026-05-30T17:37:11Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- cargo-hack (cli)
- cargo-hack (alias)

## 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.6.45
- Package-manager updated: 2026-05-30
- Local data: ok
- Upstream repository: https://github.com/taiki-e/cargo-hack
- Upstream latest detected: v0.6.45 (current)
## Project history and usage

cargo-hack is a Cargo subcommand for testing Rust packages across feature combinations, workspace selections, and Rust version ranges. It is built for the practical pain of continuous integration in feature-heavy crates.

Its best-known commands, `--each-feature` and `--feature-powerset`, make Cargo feature-matrix testing explicit and scriptable.

### Project history

The cargo-hack repository was created in October 2019 and version 0.1.0 was published to crates.io the next day. The README describes it as a Cargo subcommand providing options useful for testing and continuous integration.

The project developed around gaps in Cargo's native feature testing ergonomics. Its README references several upstream Cargo issues and documents behavior around workspaces, features, optional dependencies, package selection, and Rust version checks.

### Adoption history

cargo-hack was adopted by Rust crate maintainers who needed confidence that optional features, no-default-features builds, and workspace combinations continued to compile.

Its usage fits CI particularly well because a maintainer can run ordinary Cargo subcommands through cargo-hack while expanding the matrix of features or Rust versions under test.

### How it is used

Common usage wraps a Cargo command, for example checking every individual feature or a feature powerset. The README documents `--each-feature`, `--feature-powerset`, feature exclusions, optional dependency handling, `--rust-version`, and `--version-range`.

The tool also improves or extends behavior around existing Cargo flags such as workspace/package selection and manifest paths, keeping it close to Cargo rather than inventing a separate build system.

### Why package nerds care

cargo-hack is important to package maintainers because Rust features form part of a crate's public compatibility surface. Testing only the default feature set can miss broken optional integrations; cargo-hack makes those combinations cheap to exercise.

It is also a good example of an ecosystem utility that exists because package metadata is combinatorial: the hard part is not installing the package, it is validating all the shapes users can request from it.

### Timeline

- 2019-10-29: GitHub repository created.
- 2019-10-30: cargo-hack 0.1.0 published to crates.io.
- 2020s: README documents feature powerset, each-feature, optional dependency, workspace, and Rust-version testing flows.
- 2026: Crate has more than 1.6 million crates.io downloads and remains active.

### Related projects

- The README lists cargo-llvm-cov, cargo-minimal-versions, and cargo-config2 as related projects by the same maintainer ecosystem.
- Cargo itself is the underlying command runner and source of many linked feature/workspace issues in the README.
- cargo-minimal-versions is especially adjacent because both tools help maintainers test package compatibility beyond the default build.

### Sources

- <https://api.github.com/repos/taiki-e/cargo-hack>
- <https://crates.io/crates/cargo-hack>
- <https://github.com/taiki-e/cargo-hack#readme>


## 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-hack
- **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-hack: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-hack/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - cargo-hack - 0.6.45-r0: normalized package name match | Alpine Linux edge package indexes: cargo-hack from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Cargo subcommand to provide various options useful for testing and continuous integration. | https://github.com/taiki-e/cargo-hack
- apk - cargo-hack-doc - 0.6.45-r0: normalized package name match | Alpine Linux edge package indexes: cargo-hack-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Cargo subcommand to provide various options useful for testing and continuous integration. (documentation) | https://github.com/taiki-e/cargo-hack
- pacman - cargo-hack - 0.6.45-1: normalized package name match | Arch Linux sync databases: cargo-hack from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A cargo subcommand to provide various options useful for testing and CI | https://github.com/taiki-e/cargo-hack


## 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.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-fuzz](https://www.automicvault.com/pkg/brew/cargo-fuzz/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust, testing.
- [cargo-insta](https://www.automicvault.com/pkg/brew/cargo-insta/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust, testing.
- [cargo-nextest](https://www.automicvault.com/pkg/brew/cargo-nextest/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust, testing.
- [allure](https://www.automicvault.com/pkg/brew/allure/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [artillery](https://www.automicvault.com/pkg/brew/artillery/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [busted](https://www.automicvault.com/pkg/brew/busted/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [bzt](https://www.automicvault.com/pkg/brew/bzt/) - Shares av.db curated category or tags: cli, developer-tools, testing.
- [cargo-llvm-cov](https://www.automicvault.com/pkg/brew/cargo-llvm-cov/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust, testing.
- [cargo-chef](https://www.automicvault.com/pkg/brew/cargo-chef/) - Both packages touch the same language runtime or ecosystem. Shared terms: cargo, cli, developer, developer-tools, rust.
- [cargo-hack](https://www.automicvault.com/pkg/cargo/cargo-hack/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

View the package source record on GitHub. [combined/cargo-hack.yml](https://github.com/automic-vault/db/blob/main/combined/cargo-hack.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
