If you're using cargo-hakari or a workspace hack crate, migration takes about 5 minutes.
- No more meta-crate cluttering your workspace
- Single config file instead of hakari.toml + workspace-hack crate
- Resolution-based - uses Cargo's actual resolver output
- Multi-target aware - computes intersections across all your target triples
git checkout -b migrate-to-rail# Remove the workspace-hack crate
rm -rf crates/workspace-hack # or wherever yours lives
# Remove from workspace members in root Cargo.toml
# Remove workspace-hack dependency from all member Cargo.tomls
# Delete .config/hakari.toml if presentcargo install cargo-rail
cargo rail initEdit .config/rail.toml:
[unify]
pin_transitives = true # This replaces cargo-hakari
msrv = true # Optional: compute MSRV from deps
prune_dead_features = true# Preview first
cargo rail unify --check
# Apply changes
cargo rail unifycargo check --workspace
cargo test --workspacegit add -A
git commit -m "chore: migrate from cargo-hakari to cargo-rail"Instead of a workspace-hack crate that forces dependency unification, cargo-rail:
- Analyzes the resolved dependency graph per target triple
- Identifies transitive dependencies used by multiple workspace members
- Pins them in
[workspace.dependencies]at the root - Updates member
Cargo.tomlfiles to useworkspace = true
The result is the same build graph optimization without the meta-crate.
| cargo-hakari | cargo-rail |
|---|---|
| Workspace-hack crate | No extra crate |
| hakari.toml config | rail.toml config |
cargo hakari generate |
cargo rail unify |
| Single target | Multi-target (parallel) |
| Syntax-based | Resolution-based |
If something goes wrong:
cargo rail unify undoThis restores from the automatic backup created during unify.