Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo index add ignores cargo config source replacement config #14

Open
leighmcculloch opened this issue Sep 8, 2022 · 1 comment
Open

Comments

@leighmcculloch
Copy link

leighmcculloch commented Sep 8, 2022

It appears like the cargo index add command ignores the .cargo/config.toml source replacement config.

I have this config:

[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'local-registry'

[source.local-registry]
local-registry = '/Users/leighmcculloch/Code/registry'

I've added a crate to my local registry successfully.

When I add another crate that is dependent on the first, cargo index add appears to keep going to crates.io to check if the dependency is published there, even though the source replacement is instructing it to use the local registry. Example of error:

Caused by: `cargo metadata` exited with an error:     Updating crates.io index
error: failed to select a version for the requirement `mycratea = "^0.0.5"`
candidate versions found which didn't match: 0.0.4, 0.0.3, 0.0.2, ...
location searched: crates.io index
required by package `mycrateb v0.0.5 (/private/var/folders/75/wqcxsy716bq0qht_8jtvw85h0000gn/T/.tmpC35uNV/my-crate-b-0.0.5)`
@leighmcculloch
Copy link
Author

leighmcculloch commented Sep 8, 2022

The my-crate-a is definitely in the local registry. For example, I see this:

❯ cat registry/index/my/cr/mycratea
{"name":"mycratea","vers":"0.0.5",...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant