{"id":20872387,"url":"https://github.com/romnn/cargo-feature-combinations","last_synced_at":"2026-04-04T22:01:49.129Z","repository":{"id":60329589,"uuid":"542134373","full_name":"romnn/cargo-feature-combinations","owner":"romnn","description":"cargo plugin to run commands against all combinations of features","archived":false,"fork":false,"pushed_at":"2026-04-01T01:27:04.000Z","size":850,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-01T03:58:51.240Z","etag":null,"topics":["cargo","ci","cli","combinations","features","plugin","powerset","subcommand"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cargo-feature-combinations","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-09-27T14:39:57.000Z","updated_at":"2026-02-15T15:10:00.000Z","dependencies_parsed_at":"2024-09-15T02:35:01.577Z","dependency_job_id":"683433b5-8feb-401c-9bdd-dfe6cc80ee59","html_url":"https://github.com/romnn/cargo-feature-combinations","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"648863dca62f507ddab4d31baa1769a08c110e98"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/romnn/cargo-feature-combinations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fcargo-feature-combinations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fcargo-feature-combinations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fcargo-feature-combinations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fcargo-feature-combinations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romnn","download_url":"https://codeload.github.com/romnn/cargo-feature-combinations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romnn%2Fcargo-feature-combinations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31416332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: 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","ci","cli","combinations","features","plugin","powerset","subcommand"],"created_at":"2024-11-18T06:18:58.260Z","updated_at":"2026-04-04T22:01:49.115Z","avatar_url":"https://github.com/romnn.png","language":"Rust","readme":"## cargo-feature-combinations\n\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/actions/workflow/status/romnn/cargo-feature-combinations/build.yaml?label=build\"\u003e](https://github.com/romnn/cargo-feature-combinations/actions/workflows/build.yaml)\n[\u003cimg alt=\"test status\" src=\"https://img.shields.io/github/actions/workflow/status/romnn/cargo-feature-combinations/test.yaml?label=test\"\u003e](https://github.com/romnn/cargo-feature-combinations/actions/workflows/test.yaml)\n[![dependency status](https://deps.rs/repo/github/romnn/cargo-feature-combinations/status.svg)](https://deps.rs/repo/github/romnn/cargo-feature-combinations)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/docsrs/cargo-feature-combinations/latest?label=docs.rs\"\u003e](https://docs.rs/cargo-feature-combinations)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/cargo-feature-combinations\"\u003e](https://crates.io/crates/cargo-feature-combinations)\n\nPlugin for `cargo` to run commands against selected combinations of features.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"test-data/screenshot.png\" alt=\"cargo-feature-combinations demo\" width=\"600\"\u003e\n\u003c/p\u003e\n\n### Installation\n\n```bash\nbrew install --cask romnn/tap/cargo-fc\n\n# or install from source\ncargo install --locked cargo-feature-combinations\n```\n\n### Usage\n\nIn most cases, just use the command as if it was `cargo`:\n\n```bash\ncargo fc check\ncargo fc test\ncargo fc build\n```\n\nIn addition, there are a few optional flags and the `matrix` subcommand.\nTo get an idea, consider these examples:\n\n```bash\n# run tests and fail on the first failing combination of features\ncargo fc --fail-fast test\n\n# silence output and only show final summary\ncargo fc --silent build\n\n# print all combinations of features in JSON (useful for usage in github actions)\ncargo fc matrix --pretty\n```\n\nFor details, please refer to `--help`:\n\n```bash\n$ cargo fc --help\n\nUSAGE:\n    cargo fc [+toolchain] [SUBCOMMAND] [SUBCOMMAND_OPTIONS]\n    cargo fc [+toolchain] [OPTIONS] [CARGO_OPTIONS] [CARGO_SUBCOMMAND]\n\nSUBCOMMAND:\n    matrix                  Print JSON feature combination matrix to stdout\n        --pretty            Print pretty JSON\n\nOPTIONS:\n    --help                  Print help information\n    --silent                Hide cargo output and only show summary\n    --fail-fast             Fail fast on the first bad feature combination\n    --exclude-package       Exclude a package from feature combinations \n    --only-packages-with-lib-target\n                            Only consider packages with a library target\n    --errors-only           Allow all warnings, show errors only (-Awarnings)\n    --pedantic              Treat warnings like errors in summary and\n                            when using --fail-fast\n```\n\n### Configuration\n\nIn your `Cargo.toml`, you can configure the feature combination matrix:\n\n```toml\n[package.metadata.cargo-feature-combinations]\n# When at least one isolated feature set is configured, stop taking all project \n# features as a whole, and instead take them in these isolated sets. Build a \n# sub-matrix for each isolated set, then merge sub-matrices into the overall \n# feature matrix. If any two isolated sets produce an identical feature \n# combination, such combination will be included in the overall matrix only once.\n#\n# This feature is intended for projects with large number of features, sub-sets \n# of which are completely independent, and thus don’t need cross-play.\n#\n# Non-existent features are ignored. Other configuration options are still \n# respected.\nisolated_feature_sets = [\n    [\"foo-a\", \"foo-b\", \"foo-c\"],\n    [\"bar-a\", \"bar-b\"],\n    [\"other-a\", \"other-b\", \"other-c\"],\n]\n\n# Exclude groupings of features that are incompatible or do not make sense\nexclude_feature_sets = [ [\"foo\", \"bar\"], ] # formerly \"skip_feature_sets\"\n\n# To exclude only the empty feature set from the matrix, you can either enable\n# `no_empty_feature_set = true` or explicitly list an empty set here:\n#\n# exclude_feature_sets = [[]]\n\n# Exclude features from the feature combination matrix\nexclude_features = [\"default\", \"full\"] # formerly \"denylist\"\n\n# Skip implicit features that correspond to optional dependencies from the\n# matrix.\n#\n# When enabled, the implicit features that Cargo generates for optional\n# dependencies (of the form `foo = [\"dep:foo\"]` in the feature graph) are\n# removed from the combinatorial matrix. This mirrors the behaviour of the\n# `skip_optional_dependencies` flag in the `cargo-all-features` crate.\nskip_optional_dependencies = true\n\n# Include features in the feature combination matrix\n#\n# These features will be added to every generated feature combination.\n# This does not restrict which features are varied for the combinatorial\n# matrix. To restrict the matrix to a specific allowlist of features, use\n# `only_features`.\ninclude_features = [\"feature-that-must-always-be-set\"]\n\n# Only consider these features when generating the combinatorial matrix.\n#\n# When set, features not listed here are ignored for the combinatorial matrix.\n# When empty, all package features are considered.\nonly_features = [\"default\", \"full\"]\n\n# In the end, always add these exact combinations to the overall feature matrix, \n# unless one is already present there.\n#\n# Non-existent features are ignored. Other configuration options are ignored.\ninclude_feature_sets = [\n    [\"foo-a\", \"bar-a\", \"other-a\"],\n] # formerly \"exact_combinations\"\n\n# Allow only the listed feature sets.\n#\n# When this list is non-empty, the feature matrix will consist exactly of the\n# configured sets (after dropping non-existent features). No powerset is\n# generated.\nallow_feature_sets = [\n    [\"hydrate\"],\n    [\"ssr\"],\n]\n\n# When enabled, never include the empty feature set (no `--features`), even if\n# it would otherwise be generated.\nno_empty_feature_set = true\n\n# Optional: additional metadata merged into `cargo fc matrix` output\nmatrix = { kind = \"ci\" }\n```\n\n#### Target-specific configuration\n\nYou can override configuration for specific targets using Cargo-style `cfg(...)` expressions.\nOverrides are configured under:\n\n```toml\n[package.metadata.cargo-feature-combinations.target.'cfg(...)']\n```\n\nExample (exclude different features per OS):\n\n```toml\n[package.metadata.cargo-feature-combinations]\nexclude_features = [\"default\"]\n\n[package.metadata.cargo-feature-combinations.target.'cfg(target_os = \"linux\")']\nexclude_features = { add = [\"metal\"] }\n\n[package.metadata.cargo-feature-combinations.target.'cfg(target_os = \"macos\")']\nexclude_features = { add = [\"cuda\"] }\n```\n\nPatch semantics for collection-like keys such as `exclude_features`, `include_features`,\n`only_features`, `*_feature_sets`:\n\n- **Array syntax is always an override**\n  - `exclude_features = [\"cuda\"]` replaces the entire value.\n  - This is equivalent to `exclude_features = { override = [\"cuda\"] }`.\n- **Patch object syntax is explicit**\n  - Override (replace the entire value):\n    - `exclude_features = { override = [\"cuda\"] }`\n  - Add (union with the base value):\n    - `exclude_features = { add = [\"cuda\"] }`\n  - Remove (subtract from the base value):\n    - `exclude_features = { remove = [\"cuda\"] }`\n\nPatches are applied in order: override (or base), then remove, then add.\nIf a value appears in both `add` and `remove`, add wins.\n\nWhen multiple target override sections match (e.g. `cfg(unix)` and `cfg(target_os = \"linux\")`),\ntheir `add` and `remove` sets are unioned. Conflicting `override` values result in an error.\n\n##### `replace = true`\n\nIf a matching target override sets `replace = true`, resolution starts from a fresh default\nconfiguration (instead of inheriting from the base config). To avoid confusion, when\n`replace = true` is set, patchable fields must not use `add` or `remove` (only override\nis allowed).\n\nExample (using array shorthand, i.e. override):\n\n```toml\n[package.metadata.cargo-feature-combinations]\nexclude_features = [\"default\"]\nisolated_feature_sets = [\n  [\"gpu\"],\n  [\"ui\"],\n]\nskip_optional_dependencies = true\n\n[package.metadata.cargo-feature-combinations.target.'cfg(target_os = \"linux\")']\nreplace = true\n# Start from a fresh default config on Linux: `isolated_feature_sets` and\n# `skip_optional_dependencies` are not inherited from the base config.\nexclude_features = [\"default\", \"cuda\"]\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample: skipping optional dependency features\u003c/summary\u003e\n\n```toml\n[features]\ndefault = []\ncore = []\ncli = [\"core\"]\n\n[dependencies]\ntokio = { version = \"1\", optional = true }\nserde = { version = \"1\", optional = true }\n\n[package.metadata.cargo-feature-combinations]\nexclude_features = [\"default\"]\nskip_optional_dependencies = true\n```\n\nWith this configuration, the feature matrix will only vary the `core` and\n`cli` features. The implicit `tokio` and `serde` features that correspond to\noptional dependencies are excluded from the matrix, avoiding a combinatorial\nexplosion over integration features. If you still want to test specific\ncombinations that include `tokio` or `serde`, you can list them explicitly in\n`include_feature_sets`.\n\n\u003c/details\u003e\n\nWhen using a cargo workspace, you can also exclude packages in your workspace `Cargo.toml`:\n\n```toml\n[workspace.metadata.cargo-feature-combinations]\n# Exclude packages in the workspace metadata, or the metadata of the *root* package.\nexclude_packages = [\"package-a\", \"package-b\"]\n```\n\n\n### Usage with github-actions\n\nThe github-actions [matrix](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) feature can be used together with `cargo fc` to more efficiently test combinations of features in CI. See [GITHUB_ACTIONS.md](./docs/GITHUB_ACTIONS.md) for more information.\n\n#### Local development\n\nFor local development and testing, you can point `cargo fc` to another project using\nthe `--manifest-path` flag.\n\n```bash\ncargo run -- cargo check --manifest-path ../path/to/Cargo.toml\ncargo run -- cargo matrix --manifest-path ../path/to/Cargo.toml --pretty\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromnn%2Fcargo-feature-combinations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromnn%2Fcargo-feature-combinations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromnn%2Fcargo-feature-combinations/lists"}