← Back to Pull requests

crate_universe: resolve features and dependencies with Cargo's resolver #4456

Open
unknown opened this pull request with 208 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 24, 2026 01:25 UTC
Author

This change replaces the cargo tree resolver with Cargo's own feature resolver, through cargo-ext-resolver 0.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 metadata call is rebuilt as Cargo's Resolve, and FeatureResolver runs 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, which cargo metadata drops, is an error instead of silently losing its features (bindgen now declares those features on bindgen directly).

cfg(...) dependencies are evaluated against rustc --print=cfg output recorded per Cargo triple in src/metadata/rustc_cfgs.json, so a toolchain upgrade can no longer change a lockfile. bazel run //crate_universe:rustc_cfgs.install regenerates the table and rustc_cfgs_diff_test guards 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_vendor takes 3.1s with this change against 40.4s before (warm caches, median of three), since cargo tree ran once per supported platform triple and the feature resolver runs in-process.

The cargo tree resolver, its rustc wrapper scripts and the resolver provenance field are gone, so every lockfile is repinned. RUSTC_TRIPLES_WITH_HOST_TOOLS is reconciled with rustc's platform list, CI gains a lockfile determinism task per host platform, and util/repin_all.sh analyzes instead of querying.

Diff: 208 lines (+156 / -52) across 2 files Reviewer: UebelAndre Review duration: 10230m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
42%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 43.0% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.4% (MEDIUM) · Higher = larger blast radius
36.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 43.0% · Lower = rushed or shallow review
43.0%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 20.8% · Safe to merge
20.8%