cargo add
doesn't work with local and directory registries
#10926
Labels
cargo add
doesn't work with local and directory registries
#10926
Problem
cargo add
is unable to add crates when told to use a registry that is a local or directory registry.Steps
cargo new --lib foo && cd foo
cargo add libc
cargo check
mkdir .cargo
cargo local-registry -s Cargo.lock local-registry > .cargo/config.toml
sed '/itoa/d' Cargo.toml
cargo add --registry local-registry itoa
Produces
Alternatively, if
registry.default
is set tolocal-registry
in.cargo/config.toml
, the same error occurs without passing--registry local-registry
.Possible Solution(s)
cargo add --registry foo bar
should (assuming thatbar
exists in the registryfoo
) addto
Cargo.toml
.Ideally, I think if there's a source replacement of
crates-io
tofoo
,cargo add
should be smart enough to realize theregistry = "foo"
part should not be necessary.Notes
No response
Version
The text was updated successfully, but these errors were encountered: