-
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
cargo init is not working great when creating a new workspace with multiple members #11234
Comments
While in this specific case, the intention was to make the config valid soon with Personally, I would
|
Thanks! Suggest closing this in favor of #6378. The documentation change would be helpful for sure, though. |
By the way @epage that response time was truly awesome. Thanks much. |
Wasn't looking at which issue we are on. Considering keeping this open for the documentation side of things. |
If the suggested options make sense, I'd like to give this a try (@epage):
|
I don't think this error is worth mentioning in the docs. It is reporting things how they are. What we should be doing is adding a section at the bottom of the workspaces page that talks about common practices / recommendations. We talked some about how to handle recommendations in this zulip thread for #12323. Related examples
|
@epage You mean like this? Recommended structureHere is a good way to organize workspaces that scales well. In the root [workspace]
members = ["crates/*"]
resolver = "2" Keep this as a virtual manifest. It might be tempting to put the main crate into the root, but that pollutes the root with Next, set up subfolders where the name of each directory is equal to the name of the crate. For example, a crate named [package]
name = "hir_def"
version = "0.0.0"
edition = "2018" For really large workspaces, you may want to consider a more hierarchical structure. But a flat structure should serve you well for a long time. |
This sounds great. In fact, it sounds so great that I feel like maybe |
Problem
Got a spurious warning when creating a workspace component with
cargo init
orcargo new
. Expected it to go without issue. See below.Steps
Then made subdirectories for
feature-lib
andfeature-bin
.Then went to
feature-lib
and saidcargo init --lib
.Got this error message:
The
feature-lib
toml was created correctly, so the only real issue is the misleading message. When proceeding tofeature-bin
and runningcargo init --bin
everything worked normally.Starting without any new directories and running
cargo new --lib feature-lib
produced the same error.Possible Solution(s)
Very low priority to fix, but would be nice to suppress the unavoidable warning message in these cases. Somebody has to be created first. 🙂 . I think it would be sufficient to ignore missing or empty workspace component directories. I'm not sure why this warning exists at all, honestly: what kinds of mistakes does it protect against?
Notes
No response
Version
The text was updated successfully, but these errors were encountered: