Closed
Description
Problem
If one is using a mirror of crates.io, the error message you get when you attempt to publish is confusing. It says:
error: crates cannot be published to crates.io with dependencies sourced from other
registries either publish `bitflags` on crates.io or pull it into this repository
and specify it with a path and version
(crate `bitflags` is pulled from registry `https://github.com/rust-lang/crates.io-index`)
The last line clearly says that it is from "crates.io".
Steps
- Check out crates.io index (https://github.com/rust-lang/crates.io-index)
- Create a project with a dependency from crates.io.
- Add a
.cargo/config
file to set up the mirror:
[source.crates-io]
replace-with="mirror"
[source.mirror]
registry = "file:///path/to/crates.io-index"
cargo publish --dry-run
Possible Solution(s)
- Display a better error message, possibly instructing the user to disable the mirror.
- Detect that a mirror is being used, and allow it to proceed. This seems like it could be tricky.
Notes
- cargo 1.34.0-nightly (5c6aa46 2019-02-22)
- Reported by user "calidion" on Discord #crates-io