-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Custom registries are infectious to downstream dependents #12271
Comments
I'm not exactly sure I'm following. The absolute URI is baked as part of the publish process. If you pull from a package from registry it will depend on other packages based only on their absolute URI. In your example you have not depended on a package in registry, rather you have have a git dependency on some source code. Cargo checks out the git project you have specified and has a path dependency on the resulting working tree. Nowhere in this process does it bake in any metadata. |
That's an interesting revelation - thanks, I didn't actually test transient dependencies while going through the registry. Although, now that I'm testing with that knowledge, that brings up a surprising behaviour that the crate-a's a. ignoring it because it's going to use the path dependency anyway (see #12272), or |
|
Note that currently if you have both There are several scenario of them, and we may only need to change the behavior for git and path dependencies if we really want it.
|
[moved from #12807] Thanks @weihanglo. I do agree the inconsistency would preferably be avoided. But even now there's an inconsistency between how an unknown registry via direct/transitive dependencies surface - direct dependencies against an unknown registry give a clear error, transitive dependencies silently discard the crate from the workspace - we should maybe fix that if the plan is to keep the consistent functionality) Maybe hiding this "continue on unknown registry" functionality for the 🤯 case behind a config flag would make it more easily digestable? |
The Cargo team discussed this in the weekly meeting today. Besides the proposed solution, people can leverage Closing as this is an expected behavior and we have #6211 for improving the error message of git dependencies manifest parsing. Thank you. |
This is strange to me, dependencies do have control over the registry configuration and can depend on arbitrary registries - if, and only if, they're also depended on via a registry. If you depend on the same crate over Git the experience is completely broken. Can we at least add a environment flag to use sane behaviour (ignore a What will the error message say as a result of #6211? "Please locally define the registry that your dependency is using, but note that it isn't going to be used so this is superfluous, just deal with it"? |
Problem
When depending on custom registries over Git, the consumer is currently expected to also have a reference to the same registry in their
.cargo/config.toml
.Steps
crate-b
gives the cryptic error:Possible Solution(s)
Potentially a flag that can be set in the dependent's
.cargo/config.toml
to allow git dependencies to use arbitrary registries?Notes
No response
Version
No response
The text was updated successfully, but these errors were encountered: