-
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
Allow specifying global replacements in .cargo/config, not just crate Cargo.toml #3308
Comments
The tl;dr; here is unfortunately this is not possible. To explain a bit more in detail, this all boils down to how the two features interact with
Note that this is all possible because Now The main point is that if you can't modify So with all that in mind, we've got two use case for replacing code with something locally:
The first is Does that all make sense? With that in mind we can't literally add |
Okay, but -- why can't you modify I agree that such global configuration can lead to confusion, but there's already precedent, such as specifying
Hm, then I think there's a bug here. I have a crate that has |
The purpose of The confusion part is basically the lynchpin of why this currently isn't allowed, basically.
Oh dear! Can you file a bug? |
Yep, the confusion would be bad -- but wouldn't it be mitigated by recording the replacements in
Filed #3313 :) |
Yeah we could provide a warning, but it wouldn't solve the problem of figuring out how to regenerate Thanks for filing the issue! |
@wycats This discussion captures a lot of what we were talking about a few weeks ago around the need to only use |
I was unpleasantly surprised by these warnings popping up after a recent upgrade. I use git dependencies a lot. For development across git repositories, I have to use path overrides. I don't think I should have to make temporary changes to Cargo.toml that are never going to be checked in. |
I'm closing this issue based on this comment; please reopen and update the title and description if I've misunderstood. |
Another usecase for |
the
.cargo/config
paths
mechanism seems to be somewhat deprecated, or at least unmaintained -- e.g. if any of those crates have optional dependencies that aren't normally selected (e.g.clippy
), a warning is printed that a dependency was added on the optional ones.By contrast,
[replace]
works well, but it can only be specified in a crate's Cargo.toml, making it difficult to work with when the upstream is changing (requires rebasing your replacements to Cargo.toml, and making sure they don't get checked in accidentally).We should be able to specify global replacements in
.cargo/config
.The text was updated successfully, but these errors were encountered: