cargo-hack
« Back to VersTracker
Description:
Cargo subcommand to provide options for testing and continuous integration
Type: Formula  |  Latest Version: 0.6.39@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  @taiki_e  |  formulae.brew.sh
Category: Developer tools
Tags: rust cargo testing ci developer-tools
Install: brew install cargo-hack
About:
Cargo-hack is a Cargo subcommand that adds powerful testing capabilities to Rust projects. It enables running tests across multiple feature flag combinations, Rust versions, and workspace members without complex scripting. This tool is essential for ensuring library compatibility and robust CI pipelines by easily detecting feature-related bugs.
Key Features:
  • Test across all feature combinations with '--feature-powerset'
  • Test against multiple Rust versions using '--rust-version'
  • Run commands for each workspace member individually
  • Filter tests by package, exclude specific crates, or skip private packages
  • Supports 'cargo check' and other cargo commands, not just 'cargo test'
Use Cases:
  • Ensuring a Rust library works correctly with all possible feature flag combinations
  • Running a project's test suite against multiple Rust versions to verify MSRV compatibility
  • Debugging CI failures that only occur with specific features enabled
  • Running tests for individual crates within a large workspace
Alternatives:
  • cargo-make – A general task runner, while cargo-hack is specialized for testing matrix operations like feature sets and Rust versions.
  • shell scripts – Manual loops are brittle and complex; cargo-hack provides a robust, integrated solution for testing matrices.
License: Apache-2.0 OR MIT
Bottles available for: arm64_tahoe, arm64_sequoia, arm64_sonoma, sonoma, arm64_linux, x86_64_linux
Version History
Detected Version Rev Change Commit
Jan 16, 2025 10:02pm 0 VERSION_BUMP 64175a87
Jan 16, 2025 1:00pm 0 NEW 5fc3b7ef