Skip to content

feat(rust): add covering crates instead of refusing when features would differ - #254

Merged
adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:rust/131-feature-completion
Nov 18, 2026
Merged

adityankale190895 merged 1 commit into
DiffCI:mainfrom
FredApps:rust/131-feature-completion

Conversation

@FredApps

@FredApps FredApps commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of #131 (external dependency inputs).

When testing only the selected crates would build a shared dependency with fewer features than the full run, the planner used to refuse the command ("Selected Cargo crates would build X with different features…"). On real workspaces that turned most SELECTIVE plans into "no runnable command".

Now the planner widens the cargo:test:packages group instead: it adds the crates of the smallest Cargo feature unit that builds that dependency the full run's way, and repeats until every selected crate is covered. Features only grow with the crates selected and never exceed the full run's, so the wider command builds each dependency exactly as the full run does. It runs more tests than were selected but fewer than the full run. The label says why, e.g. "Cargo package tests (with cli for the full run's features)".

It stays fail-closed: if no unit covers a dependency, or an integration-only --test command can't be covered, the plan is refused as before. The final check over every command is unchanged.

Tests: the existing feature-resolution test is updated, and a new test covers repeated expansion across several units. One docs sentence is added.

Local checks on this head: typecheck, npm test with DIFFCI_REQUIRE_CARGO=1 (1168 pass), build, audit:boundary. Hosted CI passed on this head.

Merge order (#131 series: #232, #234, #248, #250, #252, #254, #256, #277, #258). These all edit the one-line Rust paragraph in docs/using-diffci.md, and some also touch rust.ts/types.ts, so they conflict textually with each other. #258 already includes #232, #248, #250 and #254 with those conflicts resolved. The simplest path: merge #258 (GitHub marks those four as merged), then #234, #252, #256 and #277. After each one lands I merge main into the next and resolve the docs line. Merging them one at a time in number order works too, with the same main merge after each.

…ld differ

Part of DiffCI#131 (dependency features / default-features = false). A workspace crate
that asks for a sibling with default-features = false (servo/rust-url's url asks
for percent-encoding, idna and form_urlencoded that way) made every selected
command that left out the other crates refuse, so real workspaces stayed advisory.

The package command now adds the tested crates of the smallest unit Cargo
resolved with the full run's features, repeating until every selected crate is
covered. Feature resolution is monotonic in the selected crates, so the larger
command builds those packages exactly as the full run does. Without a covering
unit, the plan is refused as before; integration-only and bench/example commands
are checked as before.

Signed-off-by: FredApps <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants