{"id":13671998,"url":"https://github.com/taiki-e/cargo-hack","last_synced_at":"2026-02-07T08:09:27.985Z","repository":{"id":35557322,"uuid":"218368572","full_name":"taiki-e/cargo-hack","owner":"taiki-e","description":"Cargo subcommand to provide various options useful for testing and continuous integration.","archived":false,"fork":false,"pushed_at":"2026-02-04T15:38:07.000Z","size":1100,"stargazers_count":798,"open_issues_count":38,"forks_count":37,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-05T03:11:35.957Z","etag":null,"topics":["cargo","cli","rust","testing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taiki-e.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"taiki-e"}},"created_at":"2019-10-29T19:35:29.000Z","updated_at":"2026-02-04T15:44:39.000Z","dependencies_parsed_at":"2023-02-14T03:45:23.098Z","dependency_job_id":"a66e9a7a-a876-4114-915a-cf1021363574","html_url":"https://github.com/taiki-e/cargo-hack","commit_stats":{"total_commits":850,"total_committers":15,"mean_commits":"56.666666666666664","dds":0.06117647058823528,"last_synced_commit":"40e8691e15e7a0d37041c45b5c2f8147aaf36c3f"},"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/taiki-e/cargo-hack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-hack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-hack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-hack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-hack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taiki-e","download_url":"https://codeload.github.com/taiki-e/cargo-hack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiki-e%2Fcargo-hack/sbom","scorecard":{"id":865828,"data":{"date":"2025-08-11","repo":{"name":"github.com/taiki-e/cargo-hack","commit":"e30e870a21cb2826e308eccff13213de9c0c59c3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/ci.yml:45","Info: jobLevel 'repository-projects' permission set to 'read': .github/workflows/ci.yml:47","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:29","Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:60","Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:4","Info: topLevel 'contents' permission set to 'read': .github/workflows/release.yml:4"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":10,"reason":"8 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:65: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:102: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:103: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:115: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/taiki-e/cargo-hack/release.yml/main?enable=pin","Info:   0 out of  16 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/taiki-e/.github/SECURITY.md:1","Info: Found linked content: github.com/taiki-e/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/taiki-e/.github/SECURITY.md:1","Info: Found text in security policy: github.com/taiki-e/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.6.37 not signed: https://api.github.com/repos/taiki-e/cargo-hack/releases/231843239","Warn: release artifact v0.6.36 not signed: https://api.github.com/repos/taiki-e/cargo-hack/releases/207189921","Warn: release artifact v0.6.35 not signed: https://api.github.com/repos/taiki-e/cargo-hack/releases/199536781","Warn: release artifact v0.6.34 not signed: https://api.github.com/repos/taiki-e/cargo-hack/releases/195171529","Warn: release artifact v0.6.33 not signed: https://api.github.com/repos/taiki-e/cargo-hack/releases/183198060","Warn: release artifact v0.6.37 does not have provenance: https://api.github.com/repos/taiki-e/cargo-hack/releases/231843239","Warn: release artifact v0.6.36 does not have provenance: https://api.github.com/repos/taiki-e/cargo-hack/releases/207189921","Warn: release artifact v0.6.35 does not have provenance: https://api.github.com/repos/taiki-e/cargo-hack/releases/199536781","Warn: release artifact v0.6.34 does not have provenance: https://api.github.com/repos/taiki-e/cargo-hack/releases/195171529","Warn: release artifact v0.6.33 does not have provenance: https://api.github.com/repos/taiki-e/cargo-hack/releases/183198060"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T02:40:36.422Z","repository_id":35557322,"created_at":"2025-08-24T02:40:36.422Z","updated_at":"2025-08-24T02:40:36.422Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29189675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","cli","rust","testing"],"created_at":"2024-08-02T09:01:23.718Z","updated_at":"2026-02-07T08:09:27.963Z","avatar_url":"https://github.com/taiki-e.png","language":"Rust","readme":"# cargo-hack\n\n[![crates.io](https://img.shields.io/crates/v/cargo-hack?style=flat-square\u0026logo=rust)](https://crates.io/crates/cargo-hack)\n[![license](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue?style=flat-square)](#license)\n[![github actions](https://img.shields.io/github/actions/workflow/status/taiki-e/cargo-hack/ci.yml?branch=main\u0026style=flat-square\u0026logo=github)](https://github.com/taiki-e/cargo-hack/actions)\n\nCargo subcommand to provide various options useful for testing and continuous\nintegration.\n\n- [Usage](#usage)\n  - [--each-feature](#--each-feature)\n  - [--feature-powerset](#--feature-powerset)\n  - [Options for adjusting the behavior of --each-feature and --feature-powerset](#options-for-adjusting-the-behavior-of---each-feature-and---feature-powerset)\n    - [--optional-deps](#--optional-deps)\n    - [--exclude-features, --skip](#--exclude-features---skip)\n  - [--rust-version](#--rust-version)\n  - [--version-range](#--version-range)\n  - [Improvement of the behavior of existing cargo flags](#improvement-of-the-behavior-of-existing-cargo-flags)\n- [Installation](#installation)\n- [Related Projects](#related-projects)\n- [License](#license)\n\n## Usage\n\n\u003cdetails\u003e\n\u003csummary\u003eComplete list of options (click to show)\u003c/summary\u003e\n\n\u003c!-- readme-long-help:start --\u003e\n```console\n$ cargo hack --help\ncargo-hack\nCargo subcommand to provide various options useful for testing and continuous integration.\n\nUSAGE:\n    cargo hack [OPTIONS] [SUBCOMMAND]\n\nUse -h for short descriptions and --help for more details.\n\nOPTIONS:\n    -p, --package \u003cSPEC\u003e...\n            Package(s) to check.\n\n        --all\n            Alias for --workspace.\n\n        --workspace\n            Perform command for all packages in the workspace.\n\n        --exclude \u003cSPEC\u003e...\n            Exclude packages from the check.\n\n        --manifest-path \u003cPATH\u003e\n            Path to Cargo.toml.\n\n        --locked\n            Require Cargo.lock is up to date.\n\n    -F, --features \u003cFEATURES\u003e...\n            Space or comma separated list of features to activate.\n\n        --each-feature\n            Perform for each feature of the package.\n\n            This also includes runs with just --no-default-features flag, and default features.\n\n            When this flag is not used together with --exclude-features (--skip) and\n            --include-features and there are multiple features, this also includes runs with just\n            --all-features flag.\n\n        --feature-powerset\n            Perform for the feature powerset of the package.\n\n            This also includes runs with just --no-default-features flag, and default features.\n\n            When this flag is used together with --depth or namespaced features (-Z\n            namespaced-features) and not used together with --exclude-features (--skip) and\n            --include-features and there are multiple features, this also includes runs with just\n            --all-features flag.\n\n        --optional-deps [DEPS]...\n            Use optional dependencies as features.\n\n            If DEPS are not specified, all optional dependencies are considered as features.\n\n            This flag can only be used together with either --each-feature flag or\n            --feature-powerset flag.\n\n        --skip \u003cFEATURES\u003e...\n            Alias for --exclude-features.\n\n        --exclude-features \u003cFEATURES\u003e...\n            Space or comma separated list of features to exclude.\n\n            To exclude run of default feature, using value `--exclude-features default`.\n\n            To exclude run of just --no-default-features flag, using --exclude-no-default-features\n            flag.\n\n            To exclude run of just --all-features flag, using --exclude-all-features flag.\n\n            This flag can only be used together with either --each-feature flag or\n            --feature-powerset flag.\n\n        --exclude-no-default-features\n            Exclude run of just --no-default-features flag.\n\n            This flag can only be used together with either --each-feature flag or\n            --feature-powerset flag.\n\n        --exclude-all-features\n            Exclude run of just --all-features flag.\n\n            This flag can only be used together with either --each-feature flag or\n            --feature-powerset flag.\n\n        --depth \u003cNUM\u003e\n            Specify a max number of simultaneous feature flags of --feature-powerset.\n\n            If NUM is set to 1, --feature-powerset is equivalent to --each-feature.\n\n            This flag can only be used together with --feature-powerset flag.\n\n        --group-features \u003cFEATURES\u003e...\n            Space or comma separated list of features to group.\n\n            This treats the specified features as if it were a single feature.\n\n            To specify multiple groups, use this option multiple times: `--group-features a,b\n            --group-features c,d`\n\n            This flag can only be used together with --feature-powerset flag.\n\n        --target \u003cTRIPLE\u003e\n            Build for specified target triple.\n\n            Comma-separated lists of targets are not supported, but you can specify the whole\n            --target option multiple times to do multiple targets.\n\n            This is actually not a cargo-hack option, it is interpreted by Cargo itself.\n\n        --mutually-exclusive-features \u003cFEATURES\u003e...\n            Space or comma separated list of features to not use together.\n\n            To specify multiple groups, use this option multiple times:\n            `--mutually-exclusive-features a,b --mutually-exclusive-features c,d`\n\n            This flag can only be used together with --feature-powerset flag.\n\n        --at-least-one-of \u003cFEATURES\u003e...\n            Space or comma separated list of features. Skips sets of features that don't enable any\n            of the features listed.\n\n            To specify multiple groups, use this option multiple times: `--at-least-one-of a,b\n            --at-least-one-of c,d`\n\n            This flag can only be used together with --feature-powerset flag.\n\n        --include-features \u003cFEATURES\u003e...\n            Include only the specified features in the feature combinations instead of package\n            features.\n\n            This flag can only be used together with either --each-feature flag or\n            --feature-powerset flag.\n\n        --no-dev-deps\n            Perform without dev-dependencies.\n\n            Note that this flag removes dev-dependencies from real `Cargo.toml` while cargo-hack is\n            running and restores it when finished.\n\n        --remove-dev-deps\n            Equivalent to --no-dev-deps flag except for does not restore the original `Cargo.toml`\n            after performed.\n\n        --no-private\n            Perform without `publish = false` crates.\n\n        --ignore-private\n            Skip to perform on `publish = false` packages.\n\n        --ignore-unknown-features\n            Skip passing --features flag to `cargo` if that feature does not exist in the package.\n\n            This flag can be used with --features, --include-features, or --group-features.\n\n        --rust-version\n            Perform commands on `package.rust-version`.\n\n            This cannot be used with --version-range.\n\n        --version-range [START]..[=END]\n            Perform commands on a specified (inclusive) range of Rust versions.\n\n            If the upper bound of the range is omitted, the latest stable compiler is used as the\n            upper bound.\n\n            If the lower bound of the range is omitted, the value of the `rust-version` field in\n            `Cargo.toml` is used as the lower bound.\n\n            Note that ranges are always inclusive ranges.\n\n        --version-step \u003cNUM\u003e\n            Specify the version interval of --version-range (default to `1`).\n\n            This flag can only be used together with --version-range flag.\n\n        --clean-per-run\n            Remove artifacts for that package before running the command.\n\n            If used this flag with --workspace, --each-feature, or --feature-powerset, artifacts\n            will be removed before each run.\n\n            Note that dependencies artifacts will be preserved.\n\n        --clean-per-version\n            Remove artifacts per Rust version.\n\n            Note that dependencies artifacts will also be removed.\n\n            This flag can only be used together with --version-range flag.\n\n        --keep-going\n            Keep going on failure.\n\n        --partition \u003cM/N\u003e\n            Partition runs and execute only its subset according to M/N.\n\n        --log-group \u003cKIND\u003e\n            Log grouping: none, github-actions.\n\n            If this option is not used, the environment will be automatically detected.\n\n        --print-command-list\n            Print commands without run (Unstable).\n\n        --no-manifest-path\n            Do not pass --manifest-path option to cargo (Unstable).\n\n    -v, --verbose\n            Use verbose output.\n\n        --color \u003cWHEN\u003e\n            Coloring: auto, always, never.\n\n            This flag will be propagated to cargo.\n\n    -h, --help\n            Prints help information.\n\n    -V, --version\n            Prints version information.\n\nSome common cargo commands are (see all commands with --list):\n    build       Compile the current package\n    check       Analyze the current package and report errors, but don't build object files\n    run         Run a binary or example of the local package\n    test        Run the tests\n```\n\u003c!-- readme-long-help:end --\u003e\n\n\u003c/details\u003e\n\n`cargo-hack` is basically wrapper of `cargo` that propagates subcommand and most\nof the passed flags to `cargo`, but provides additional flags and changes the\nbehavior of some existing flags.\n\n### --each-feature\n\nPerform for each feature which includes default features and\n`--no-default-features` of the package.\n\nThis is useful to check that each feature is working properly. (When used for\nthis purpose, it is recommended to use with `--no-dev-deps` to avoid\n[cargo#4866].)\n\n```sh\ncargo hack check --each-feature --no-dev-deps\n```\n\nSee also [Options for adjusting the behavior of --each-feature and --feature-powerset](#options-for-adjusting-the-behavior-of---each-feature-and---feature-powerset) section.\n\n### --feature-powerset\n\nPerform for the feature powerset which includes `--no-default-features` and\ndefault features of the package.\n\nThis is useful to check that every combination of features is working\nproperly. (When used for this purpose, it is recommended to use with\n`--no-dev-deps` to avoid [cargo#4866].)\n\n```sh\ncargo hack check --feature-powerset --no-dev-deps\n```\n\ncargo-hack deduplicate any fully equivalent feature combinations based on how the cargo features work. Therefore, it may be more efficient than checking all feature combinations in other ways.\n\n\u003e [!TIP]\n\u003e When using this flag results in a very large number of feature combinations, consider using [`--depth`](#--depth) option.\n\nSee also [Options for adjusting the behavior of --each-feature and --feature-powerset](#options-for-adjusting-the-behavior-of---each-feature-and---feature-powerset) section.\n\n### Options for adjusting the behavior of --each-feature and --feature-powerset\n\nThe following flags can be used with `--each-feature` and `--feature-powerset`.\n\n#### --optional-deps\n\nUse optional dependencies as features.\n\nThis flag treats all option dependencies as features by default.\nTo treat only specific dependencies as features, pass a space or comma separated list.\n\n```sh\ncargo hack check --feature-powerset --optional-deps deps1,deps2\n```\n\n#### --exclude-features, --skip\n\nSpace or comma separated list of features to exclude.\n\n```sh\ncargo hack check --feature-powerset --exclude-features feature1,feature2\ncargo hack check --feature-powerset --skip feature1,feature2\n```\n\n\u003c!-- omit in toc --\u003e\n#### --depth\n\nSpecify a max number of simultaneous feature flags of `--feature-powerset`.\n\nIf the number is set to 1, `--feature-powerset` is equivalent to\n`--each-feature`.\n\n\u003c!-- omit in toc --\u003e\n#### --group-features\n\nSpace or comma separated list of features to group.\n\nThis treats the specified features as if it were a single feature.\n\nTo specify multiple groups, use this option multiple times:\n`--group-features a,b --group-features c,d`\n\n### --rust-version\n\nPerform commands on the Rust version of `package.rust-version` field in `Cargo.toml`\n\n### --version-range\n\nPerform commands on a specified (inclusive) range of Rust versions.\n\n```console\n$ cargo hack check --version-range 1.46..=1.47\ninfo: running `rustup run 1.46 cargo check` on cargo-hack (1/2)\n...\ninfo: running `rustup run 1.47 cargo check` on cargo-hack (2/2)\n...\n```\n\n(We use `rustup run \u003ctoolchain\u003e cargo` instead of `cargo +\u003ctoolchain\u003e` to work around a [rustup bug](https://github.com/rust-lang/rustup/issues/3036).)\n\nThis might be useful for catching issues like [termcolor#35], [regex#685],\n[rust-clippy#6324].\n\nIf the upper bound of the range is omitted, the latest stable compiler is used as the upper bound.\n\nIf the lower bound of the range is omitted, the value of the `rust-version` field in `Cargo.toml` is used as the lower bound.\n\nYou can specify the version interval by using `--version-step`.\n\n\u003c!-- omit in toc --\u003e\n### --no-dev-deps\n\nPerform without dev-dependencies.\n\nThis is a workaround for an issue that dev-dependencies leaking into normal\nbuild ([cargo#4866]).\n\nAlso, this can be used as a workaround for an issue that `cargo` does not\nallow publishing a package with cyclic dev-dependencies. ([cargo#4242])\n\n```sh\ncargo hack publish --no-dev-deps --dry-run --allow-dirty\n```\n\n\u003e [!NOTE]\n\u003e Currently, using `--no-dev-deps` flag removes dev-dependencies from\n\u003e real manifest while cargo-hack is running and restores it when finished.\n\u003e Any changes you made to those files during running will not be preserved.\n\u003e See [cargo#4242] for why this is necessary.\n\u003e Also, this behavior may change in the future on some subcommands. See also\n\u003e [#15].\n\n\u003c!-- omit in toc --\u003e\n### --remove-dev-deps\n\nEquivalent to `--no-dev-deps` except for does not restore the original\n`Cargo.toml` after execution.\n\nThis is useful to know what Cargo.toml that cargo-hack is actually using\nwith `--no-dev-deps`.\n\n*This flag also works without subcommands.*\n\n\u003c!-- omit in toc --\u003e\n### --ignore-private\n\nSkip to perform on `publish = false` crates.\n\n\u003c!-- omit in toc --\u003e\n### --no-private\n\nPerform without `publish = false` crates. This is similar to `--ignore-private`, but is more powerful because this also prevents private crates from affecting lockfile and metadata.\n\n\u003e [!NOTE]\n\u003e `--no-private` flag modifies `Cargo.toml` while cargo-hack is running and restores it when finished. Any changes you made to those files during running will not be preserved.\n\n\u003c!-- omit in toc --\u003e\n### --ignore-unknown-features\n\nSkip passing `--features` to `cargo` if that feature does not exist.\n\n\u003c!-- omit in toc --\u003e\n### --clean-per-run\n\nRemove artifacts for that package before running the command.\n\nThis also works as a workaround for [rust-clippy#4612].\n\n### Improvement of the behavior of existing cargo flags\n\n`cargo-hack` changes the behavior of the following existing flags.\n\n\u003c!-- omit in toc --\u003e\n#### --features, --no-default-features\n\nUnlike `cargo` ([cargo#3620], [cargo#4106], [cargo#4463], [cargo#4753],\n[cargo#5015], [cargo#5364], [cargo#6195]), it can also be applied to\nsub-crates.\n\n\u003c!-- omit in toc --\u003e\n#### --all, --workspace\n\nPerform command for all packages in the workspace.\n\nUnlike cargo, it does not compile all members at once.\n\nFor example, running `cargo hack check --all` in a workspace with members\n`foo` and `bar` behaves almost the same as the following script:\n\n```sh\n# If you use cargo-hack, you don't need to maintain this list manually.\nmembers=(\"foo\" \"bar\")\n\nfor member in \"${members[@]}\"; do\n    cargo check --manifest-path \"${member}/Cargo.toml\"\ndone\n```\n\n*Workspace members will be performed according to the order of the 'packages'\nfields of [`cargo metadata`][cargo-metadata].*\n\n## Installation\n\n\u003c!-- omit in toc --\u003e\n### From source\n\n```sh\ncargo +stable install cargo-hack --locked\n```\n\nCurrently, installing cargo-hack requires rustc 1.82+.\n\ncargo-hack is usually runnable with Cargo versions older than the Rust version\nrequired for installation (e.g., `cargo +1.31 hack check`). Currently, to run\ncargo-hack requires Cargo 1.26+.\n\n\u003c!-- omit in toc --\u003e\n### From prebuilt binaries\n\nYou can download prebuilt binaries from the [Release page](https://github.com/taiki-e/cargo-hack/releases).\nPrebuilt binaries are available for Linux (x86_64 gnu/musl, aarch64 gnu/musl, powerpc64le gnu/musl, riscv64gc gnu/musl, and s390x gnu, musl binaries are static executable), macOS (x86_64, aarch64, and universal), Windows (x86_64 and aarch64, static executable), FreeBSD (x86_64), and illumos (x86_64).\n\n\u003cdetails\u003e\n\u003csummary\u003eExample of script to install from the Release page (click to show)\u003c/summary\u003e\n\n```sh\n# Get host target\nhost=$(rustc -vV | grep '^host:' | cut -d' ' -f2)\n# Download binary and install to $HOME/.cargo/bin\ncurl --proto '=https' --tlsv1.2 -fsSL \"https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-$host.tar.gz\" \\\n  | tar xzf - -C \"$HOME/.cargo/bin\"\n```\n\n\u003c/details\u003e\n\n\u003c!-- omit in toc --\u003e\n### On GitHub Actions\n\nYou can use [taiki-e/install-action](https://github.com/taiki-e/install-action) to install prebuilt binaries on Linux, macOS, and Windows.\nThis makes the installation faster and may avoid the impact of [problems caused by upstream changes](https://github.com/tokio-rs/bytes/issues/506).\n\n```yaml\n- uses: taiki-e/install-action@cargo-hack\n```\n\n\u003c!-- omit in toc --\u003e\n### Via Homebrew\n\nYou can install cargo-hack from [homebrew-core](https://formulae.brew.sh/formula/cargo-hack) (x86_64/AArch64 macOS, x86_64/AArch64 Linux):\n\n```sh\nbrew install cargo-hack\n```\n\nAlternatively, you can also install from the [Homebrew tap maintained by us](https://github.com/taiki-e/homebrew-tap/blob/HEAD/Formula/cargo-hack.rb) (x86_64/AArch64 macOS, x86_64/AArch64 Linux):\n\n```sh\nbrew install taiki-e/tap/cargo-hack\n```\n\n\u003c!-- omit in toc --\u003e\n### Via Scoop (Windows)\n\nYou can install cargo-hack from the [Scoop bucket maintained by us](https://github.com/taiki-e/scoop-bucket/blob/HEAD/bucket/cargo-hack.json):\n\n```sh\nscoop bucket add taiki-e https://github.com/taiki-e/scoop-bucket\nscoop install cargo-hack\n```\n\n\u003c!-- omit in toc --\u003e\n### Via cargo-binstall\n\nYou can install cargo-hack using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall):\n\n```sh\ncargo binstall cargo-hack\n```\n\n\u003c!-- omit in toc --\u003e\n### Via pacman (Arch Linux)\n\nYou can install cargo-hack from the [extra repository](https://archlinux.org/packages/extra/x86_64/cargo-hack):\n\n```sh\npacman -S cargo-hack\n```\n\n\u003c!-- omit in toc --\u003e\n### Via ports (FreeBSD)\n\nYou can install cargo-hack from the [official ports](https://www.freshports.org/devel/cargo-hack):\n\n```sh\npkg install cargo-hack\n```\n\n\u003c!-- omit in toc --\u003e\n### Via other package managers\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/cargo-hack.svg?columns=4)](https://repology.org/project/cargo-hack/versions)\n\n## Related Projects\n\n- [cargo-llvm-cov]: Cargo subcommand to easily use LLVM source-based code coverage.\n- [cargo-minimal-versions]: Cargo subcommand for proper use of `-Z minimal-versions`.\n- [cargo-config2]: Library to load and resolve Cargo configuration.\n- [cargo-no-dev-deps]: Cargo subcommand for running cargo without dev-dependencies. This is an extraction of the [`--no-dev-deps` flag of cargo-hack](#--no-dev-deps) to be used as a stand-alone cargo subcommand.\n\n[#15]: https://github.com/taiki-e/cargo-hack/issues/15\n[cargo-config2]: https://github.com/taiki-e/cargo-config2\n[cargo-llvm-cov]: https://github.com/taiki-e/cargo-llvm-cov\n[cargo-metadata]: https://doc.rust-lang.org/cargo/commands/cargo-metadata.html\n[cargo-minimal-versions]: https://github.com/taiki-e/cargo-minimal-versions\n[cargo-no-dev-deps]: https://github.com/taiki-e/cargo-no-dev-deps\n[cargo#3620]: https://github.com/rust-lang/cargo/issues/3620\n[cargo#4106]: https://github.com/rust-lang/cargo/issues/4106\n[cargo#4242]: https://github.com/rust-lang/cargo/issues/4242\n[cargo#4463]: https://github.com/rust-lang/cargo/issues/4463\n[cargo#4753]: https://github.com/rust-lang/cargo/issues/4753\n[cargo#4866]: https://github.com/rust-lang/cargo/issues/4866\n[cargo#5015]: https://github.com/rust-lang/cargo/issues/4463\n[cargo#5364]: https://github.com/rust-lang/cargo/issues/5364\n[cargo#6195]: https://github.com/rust-lang/cargo/issues/6195\n[regex#685]: https://github.com/rust-lang/regex/issues/685\n[rust-clippy#4612]: https://github.com/rust-lang/rust-clippy/issues/4612\n[rust-clippy#6324]: https://github.com/rust-lang/rust-clippy/issues/6324\n[termcolor#35]: https://github.com/BurntSushi/termcolor/issues/35\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or\n[MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n","funding_links":["https://github.com/sponsors/taiki-e"],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fcargo-hack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaiki-e%2Fcargo-hack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiki-e%2Fcargo-hack/lists"}