-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Unable to use workspace dependency in patch #15568
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
Comments
This comment has been minimized.
This comment has been minimized.
We should fix that error message to not mention workspace dependencies. Could you help me understand your motivation for wanting to use a workspace dependency in a patch? |
To make sure dependencies use the crate version defined in |
If its in |
I don't understand. I can't inherit the workspace dependency for dependencies (which are not in the workspace) of workspace members. That's why I'm using a patch. Am I misunderstanding? |
Ok, so you are patching a transitive dependency. You mentioned you want the version/source to be in Is this patch considered to be temporary or will you be maintaining it long term? |
I gain the same value as when I specify shared dependencies in |
We've had a lot of back and forth. If there is more, it might be good to provide a complete but minimal reproduction case which might help clarify some of the points of what you are doing. |
There is one nasty difficulty of supporting this: On the other hand, while what you're doing is not disallowed, I would suggest using crates.io dependencies in
|
Looks like we have #12031 for tracking the quality of that error message |
How can that be? I thought crates.io crates can't have git dependencies. I rely on features present only in the git repo.
It's duplicated, just once. That still counts though. And this issue has a minimal reproduction case. The rest of the project is just empty. What I'm doing is just re-using the workspace dep in the patch like I would anywhere else. |
To clarify, I meant something like [workspace.dependencies]
shakmaty = "0.27.3"
[patch.crates-io]
shakmaty = { git = "https://github.com/niklasf/shakmaty", branch = "master", default-features = false } So your package will be ready to publish after shakmaty release a new version and you bump it. You don't need to modify the dependency declaration again. |
I tried this code:
I expected to see this happen: dependencies that use shakmaty from crates.io get replaced by the git version.
Instead, this happened:
The error says I can use a workspace dependency.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: