-
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
Improve multi-crate project management #2122
Comments
I keep running into needing some project level cargo for large projects. I was thinking if something like this would help: [project]
name = "theproject"
version = "0.1.0"
authors = ["people"]
readme = "README.md"
description = "..."
[crates]
onecrate = "0.1"
another = { git = "https://github.com/some/dude" }
relative = { path="./some/other" } # weird, but might happen
# feature crates
uhg = { optional = true }
[features]
nightly = ["uhg"] Having the special
We can also have a common crate cache, if a bunch of the project crates share the same dependencies there is no need compile them all over and over again. @alexcrichton what are your thoughts on this? Could we get some traction to get "project" support on cargo? cc: @jsgf |
Thanks for the comment @icorderi! I've been thinking about this recently and I hope to soon formulate what I'm thinking into an RFC. I suspect that this will basically manifest itself in somehow linking together Cargo.toml files into one common "parent". To me most commands would continue to basically just work "as-is" today without many changes. Grouping projects together would primarily:
I think that some operations that are out of scope in the short term are:
Basically operations that work over an entire tree probably want to be held off for now. Perhaps one day we can add such support but for now it may be premature and just bog down the design. |
@alexcrichton looking forward to that RFC. |
Ok, I've got a draft now, yay! @icorderi curious as to your thoughts on -- https://github.com/alexcrichton/rfcs/blob/cargo-workspace/text/0000-cargo-workspace.md? |
er, wrong RFC, fixed the link |
I've now opened an RFC for this issue. |
Any good news? :) |
Ah oops, I forgot to link the implementation PR! I have an implementation here: #2759 |
Great! |
Done! Workspaces landed |
@alexcrichton That's so awesome! Can't wait to try them out in my project! |
@alexcrichton |
Cargo's story around having a project (or a repo) with many crates isn't the best right now, there are a number of papercuts that add up over time:
Cargo.lock
, which means that each crate can be working with a different set of dependencies. Not only is it difficult to manage all these lockfiles but it's often not desired to have different sets of dependencies when working in the source tree.target
folders, meaning crates are recompiled as you move around the project tree.cargo test -p foo
for a crate that has a dev-dependencyDev-dependencies
are not linked when testing subpackages #860I'll likely add more over time!
The text was updated successfully, but these errors were encountered: