-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Using alternative registries names in text output #6691
Comments
Similarly, it'd be great if you could use the registry name in patch blocks: [dependencies]
my-crate = { version = "0.1", registry = "my-index" }
# Currently required
[patch."https://gitlab.com/xxx/cargo/crates-index"]
my-crate = { git = "..." }
# Way less annoying
[patch.my-index]
my-crate = { git = "..." } |
I think |
Oh yay, I forgot about that :D |
This would indeed be a nice change to have! Not just because it looks nicer and cleaner in the log output but also because now when it logs out the full URL to the alternative registry it can "leak" out private details. For example we use a cloudsmith.io private registry and that has a secret token in the URL that without this Cargo logs out on every use which is unecessary and increases the chance of it being leaked out. Example:
|
Did a quick investigation of this in the Cargo code, looks a bit tricky because the dependencies in the Cargo.toml have their So then when constructing a |
@rustbot claim |
Not sure how far will #9632 go. Feel free to comment on that PR. |
Now, that alternative registries have been stabilized, they are referenced by the index URL, which is definitely unique. However, it is not necessarily a human-friendly and may be quite long at times.
crates.io, on the other hand, is called just that - "crates.io".
Here is how it shows when running
cargo update
The index URL is listed only in the
.cargo/config
and not inCargo.toml
, so it may be not readily recognizable by the user and/or linked to the alternative registry in use (especially if a number of different alt registries are in use simultaneously)I suggest to use the name of the registry instead and fallback to the URL only when the name is
None
(it is defined asOption<String>
)The text was updated successfully, but these errors were encountered: