Migrate from Cargo
Convert an existing Cargo workspace to rusty.json and rusty.lock.
rusty can adopt an existing Cargo project without rewriting sources. Migration produces rusty.json and rusty.lock while preserving your crate layout.
Check first
Preview what migration would do:
rusty migrate --dry-runInteractive migration
On a TTY, rusty migrate explains the conversion and asks for confirmation:
rusty migrateNon-interactive (CI)
rusty migrate --yesWithout a TTY, --yes is required or the command exits with an error.
Automatic prompts
Several commands detect an unmigrated Cargo tree and offer migration before proceeding:
rusty initinside a directory withCargo.tomlrusty lock,rusty add,rusty build,rusty test(with interactive migration allowed)
Declining migration leaves the project on Cargo manifests; rusty continues to use cargo passthrough with CAS-backed CARGO_HOME.
After migration
- Review generated
rusty.jsonandrusty.lock. - Run
rusty fetchto ingest dependencies into the store. - Run
rusty buildandrusty testto validate the native driver path. - Commit the new manifest files when satisfied.
If the project is already rusty-native, rusty migrate exits with an error — there is nothing to convert.
Lockfiles
| Before | After |
|---|---|
Cargo.toml + Cargo.lock | rusty.json + rusty.lock |
rusty lock regenerates the appropriate lockfile for whichever format the project uses.
Rolling back
Keep the git history. To revert, restore Cargo.toml / Cargo.lock from before migration and remove rusty.json / rusty.lock. The CAS contents in ~/.rusty/ are safe to retain — they are content-addressed and reusable.