You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Sync bidirectionally**- Monorepo to split repo and back. External changes create PR branches.
39
43
40
44
```bash
41
45
cargo rail sync my-crate
42
46
```
43
47
44
-
**Release with ordering**— Dependency-ordered publishing. Native changelog generation.
48
+
**Release with ordering**- Dependency-ordered publishing with changelog generation.
45
49
46
50
```bash
47
-
cargo rail release run --all --bump minor --check
51
+
cargo rail release run --all --bump minor
48
52
```
49
53
50
54
---
51
55
52
-
## Why cargo-rail
56
+
## How It Works
53
57
54
-
**11 dependencies, ~100 resolved.** Compare: cargo-hakari pulls ~40 direct via guppy. release-plz pulls 600+ resolved.
58
+
cargo-rail runs `cargo metadata --filter-platform` for each target triple in your workspace, then computes:
55
59
56
-
**Multi-target resolution.** Queries Cargo's actual resolver across all your target triples. Computes intersection of required features (not union).
60
+
1.**Resolved versions** - What Cargo's resolver actually picked, not declared versions
61
+
2.**Feature sets** - Intersection for workspace deps, union fallback for edge cases
62
+
3.**MSRV floor** - Maximum `rust-version` from the entire resolved graph
63
+
4.**Unused deps** - Declared but absent from resolution
64
+
5.**Dead features** - Declared but never enabled anywhere
57
65
58
-
**System git.** Uses `git` binary directly. No libgit2/gitoxide. Deterministic SHAs. git-notes for rebase-safe commit mapping.
66
+
One metadata pass per target. No additional cargo invocations. No workspace-hack crate.
59
67
60
-
**Lossless TOML.** Uses `toml_edit` to preserve comments and formatting.
68
+
---
69
+
70
+
## The Unify Algorithm
71
+
72
+
**Versions**: Uses Cargo's resolved versions across all configured targets. Multiple major versions of the same dep trigger a warning and skip unification for that dep (configurable to force-bump to highest).
73
+
74
+
**Features**: Workspace deps carry the intersection (common features across all usages). Members declare local additions via `features = ["extra"]`. Target-specific features (`[target.'cfg(...)'.dependencies]`) stay in member manifests.
75
+
76
+
**MSRV**: Computes the maximum `rust-version` declared by any package in your resolved dependency graph. This is your buildable floor - the minimum Rust version that can compile your workspace. Written to `[workspace.package].rust-version`.
77
+
78
+
**Unused deps**: Compares declared dependencies against the resolved graph. If a dep isn't in the resolution for any configured target, it's unused. Conservative filters prevent false positives for optional deps, feature-gated deps, and unconfigured targets.
79
+
80
+
**Dead features**: Features declared but never enabled in the resolved graph. Only empty no-op features (`feature = []`) are pruned. Features that enable something are reported but preserved - they're user-facing API.
81
+
82
+
**Transitive pinning**: Optional. Detects transitive-only deps with fragmented features across targets and pins them in `[workspace.dependencies]`. Replaces workspace-hack crates without the lockstep maintenance.
61
83
62
84
---
63
85
@@ -69,12 +91,11 @@ cargo rail release run --all --bump minor --check
69
91
|`test`| Run tests for affected crates only |
70
92
|`unify`| Unify deps to `[workspace.dependencies]`|
71
93
|`split`| Extract crate to standalone repo with history |
0 commit comments