cargo-hack icon indicating copy to clipboard operation
cargo-hack copied to clipboard

`--partition N/M` doesn't distribute jobs properly

Open elichai opened this issue 2 months ago • 1 comments

When running cargo hack check --feature-powerset --partition N/5 and there are 11 number of options we get a very uneven distribution in partitions, where the last partition is actually empty

Full details:

For the following Cargo.toml:

[package]
name = "yoyo"
version = "0.1.0"
edition = "2024"

[features]
a = []
b = []
c = []
d = ["a", "b"]
e = ["d", "c"]

using --feature-powerset there are 11 options, when using 5 partitions we get: 1:

cargo check --no-default-features (1/11)
cargo check --no-default-features --features e (2/11)
cargo check --no-default-features --features a (3/11)

2:

cargo check --no-default-features --features b (4/11)
cargo check --no-default-features --features a,b (5/11)
cargo check --no-default-features --features c (6/11)

3:

cargo check --no-default-features --features a,c (7/11)
cargo check --no-default-features --features b,c (8/11)
cargo check --no-default-features --features a,b,c (9/11)

4:

cargo check --no-default-features --features d (10/11)
cargo check --no-default-features --features c,d (11/11)

5:

elichai avatar Oct 12 '25 09:10 elichai

cc @ryoqun (who implemented this option in https://github.com/taiki-e/cargo-hack/pull/253)

taiki-e avatar Oct 12 '25 14:10 taiki-e