Ah, I think it might actually be fine, but there was a subtle edge case in how Cargo deals with crates with features that enable features of thier dev-dependencies. I've made some changes to Margo to address that, which should be available if you grab version 0.1.5. With those changes, I did the same process as before:
- Create a new repo
- Add a crate to it with
cargo add(I chose serde_json) - Set an alternate
CARGO_HOMEdirectory - Run
cargo fetch - Get the crates from the alternate
CARGO_HOMEand add them to a Margo registry.
Then I set up my usage crate with a .cargo/config.toml to use Margo instead of crates.io:
[registries]
my-awesome-registry = { index = "sparse+http://[::1]:9999/" }
[source.crates-io]
replace-with = "my-awesome-registry"
With that, I was able to build:
% cargo build
Updating `my-awesome-registry` index
Downloaded itoa v1.0.11 (registry `my-awesome-registry`)
Downloaded memchr v2.7.4 (registry `my-awesome-registry`)
Downloaded ryu v1.0.18 (registry `my-awesome-registry`)
Downloaded serde v1.0.209 (registry `my-awesome-registry`)
Downloaded serde_json v1.0.127 (registry `my-awesome-registry`)