crate_universe: resolve features and dependencies with Cargo's resolver #4456
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.36) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 208 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.320
Real PR Conversation Timeline
1 comments
"Review active on #4456"
general
weight: 0.35
UebelAndre
This change replaces the
cargo treeresolver with Cargo's own feature resolver, throughcargo-ext-resolver0.101.0, the resolver of the Cargo shipped with Rust 1.100.0 extracted as a crate(https://github.com/cargo-extracted/cargo-extracted). The package graph of one
cargo metadatacall is rebuilt as Cargo'sResolve, andFeatureResolverruns over it in-process once per (host, target) pair with the host an explicit input. Crates reached only through a proc-macro or a build script are resolved for the host that builds them, and a binary-only dependency, whichcargo metadatadrops, is an error instead of silently losing its features (bindgen now declares those features onbindgendirectly).cfg(...)dependencies are evaluated againstrustc --print=cfgoutput recorded per Cargo triple insrc/metadata/rustc_cfgs.json, so a toolchain upgrade can no longer change a lockfile.bazel run //crate_universe:rustc_cfgs.installregenerates the table andrustc_cfgs_diff_testguards it. An unknown triple still falls back to rustc with a warning.Repinning rules_rust's own vendored crates with
bazel run //crate_universe/3rdparty:crates_vendortakes 3.1s with this change against 40.4s before (warm caches, median of three), sincecargo treeran once per supported platform triple and the feature resolver runs in-process.The
cargo treeresolver, its rustc wrapper scripts and theresolverprovenance field are gone, so every lockfile is repinned.RUSTC_TRIPLES_WITH_HOST_TOOLSis reconciled with rustc's platform list, CI gains a lockfile determinism task per host platform, andutil/repin_all.shanalyzes instead of querying.