-
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
Allow manifest dependencies of same-workspace crates to use workspace = true
#13453
Comments
workspace = true
workspace = true
The original RFC took a different approach, making This was rejected during stabilization which had some complications. I suspect this will run into some of the same. Not knowing what version you intend to use when publishing can get complicated. If we limited the design to path dependencies only, that helps but that leaves off a good segment of users. |
Then can't we alter publishing? This doesn't seem impossible, but it is indeed complicated. Where to start?
What are other cases? I don't understand. |
We'd need to do so in a way that is backwards compatible and where the solution is not worse than the problem. The cargo team is limited in its bandwidth for efforts it can shepherd. For myself I can't commit to helping in driving this process. For an idea of what we are working on instead, see https://blog.rust-lang.org/inside-rust/2024/02/13/this-development-cycle-in-cargo-1-77.html
The big problem is when you want publish a package with a path dependency. In that case, you need to specify the If we make these implicit dependencies only exist with path dependencies, and not version dependencies, then we avoid a lot of the problems but then we make this only work for internal packages. |
This came up in conversation. In designing this, we'd need to decide how each field field gets set
|
Another challenge with resolving this is in the implementation: we can't fully load a package until all packages in the workspace are partially loaded so we know what path (and maybe version) to use for each dependency. We've been trying to avoid multi-phase manifest parsing, especially mult-phase normalization. Manifest parsing is also very complex and I worry about adding to that complexity. |
Problem
I have 100+ workspace crates. In order for any of them to use each other, they need to use relative path.
It would be nice to just use:
for in-workspace crates when referring to other same-workspace dependencies. That way, I can move crates around + rename crates easily without having to edit every manifest that uses it in the workspace.
Proposed Solution
It should theoretically be possible without any surface changes at the manifest level. Each workspace crate has a canonical name, and alias could be handled through some additional spec field.
Notes
No response
The text was updated successfully, but these errors were encountered: