-
Notifications
You must be signed in to change notification settings - Fork 949
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
*: Move libp2p
meta crate into its own directory
#3012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with this. I am guessing that this is also the conventional way of doing things? Any big projects out there that does what we do today?
core/Cargo.toml
Outdated
@@ -46,7 +46,7 @@ ring = { version = "0.16.9", features = ["alloc", "std"], default-features = fal | |||
async-std = { version = "1.6.2", features = ["attributes"] } | |||
base64 = "0.13.0" | |||
criterion = "0.4" | |||
libp2p = { path = "..", features = ["full"] } | |||
libp2p = { path = "../meta/", features = ["full"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libp2p = { path = "../meta/", features = ["full"] } | |
libp2p = { path = "../libp2p/", features = ["full"] } |
Would it not make sense to name the folder like the crate name? Tokio seems to do just that. What do other projects do?
https://github.com/tokio-rs/tokio/tree/master/tokio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you rename all the other directories to their actual crate name too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a bit of repetition but I think I'd prefer just straight up using the crate name for all directories.
The directory hierarchy is also something I am not too sure about but that is orthogonal :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you rename all the other directories to their actual crate name too?
Given that each of them are sub-crates of libp2p
, I think it is fine to keep them as is.
I don't know of any but also haven't done any explicit research. For me, having a dedicated virtual manifest feels cleaner :) |
This pull request has merge conflicts. Could you please resolve them @thomaseizinger? 🙏 |
I don't really have an opinion on both the introduction of a pure workspace crate and the rename of the folders. Off the top of my head I would say it is not worth the change. That said, I think @thomaseizinger you feel strongly about it. Thus happy to move forward unless anyone has objections. |
What about a layout with:
|
Would
But I also don't feel strongly about this. |
The difference would be:
Thanks for adding opinion. Despite being slightly redundant, I also prefer the direct mapping of directory to crate name. |
I am not sure. I always found this only semi helpful. Even though I understand the categorization, my brain primarily works in names (e.g. I want to modify From that perspective, my vote would be: No, those directories would be gone. |
A better name for |
I find the directories helpful, especially for newcomers, as they provide structure to the otherwise chaotic flood of crates that |
Sorry to question this so bluntly but is this just a guess or actual feedback from newcomers? I can see why the number of crates could be overwhelming for newcomers, however, I am not sure whether a directory structure is the best way to help here. Personally, I'd find a UML diagram that visualises the dependencies much more useful. Such a diagram could be auto-generated with a script by inspecting I would like to push #3072 (comment) forward in the near future, so we will get a few new crates where it is not obvious, which directory they should go in. As we untangle some of the existing abstractions, I think this directory structure will also need revisiting. |
No worries. Please question every word I write. It is my intuition that the directory structure makes it easier for newcomers to find their way around. That said, it is an intuition only and I don't remember my own experience getting familiar with the structure. |
- Moved with libp2p#3012 - Dependabot always shows root `CHANGELOG.md` in pull request on dependent repository
Description
Currently, our top-level
Cargo.toml
manifest represents a crate AND a workspace. This causes surprising behaviour (e.g. #2949 ) where we need to explicitly pass--workpace
to every command to run it on the entire workspace and not just the meta crate.My moving the meta crate into its own directory, the root manifest file is a virtual manifest only and thus, every
cargo
command will automatically default to running on the entire workspace.I am setting this as draft for now. Will audit any broken links once there is consensus on doing this.
Links to any relevant issues
Open Questions
Open tasks
Change checklist
I have made corresponding changes to the documentationI have added tests that prove my fix is effective or that my feature worksA changelog entry has been made in the appropriate crates