-
Notifications
You must be signed in to change notification settings - Fork 12
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
refacto: extract the core crate from the CLI #242
Conversation
Hi @poliorcetics I agree with the fact that we pull in some unused dependencies in the current state of the crate but I disagree with the splitting:
So iiuc and the goal is to minimize the dependency footprint buffrs has when being used as a build dependencies I think the most meaningless ways to achieve this are:
|
serde.workspace = true | ||
serde_json.workspace = true | ||
tar.workspace = true | ||
thiserror.workspace = true | ||
tokio.workspace = true |
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.
So my hint here was basically, we will save something by this layout! But it's mostly tokio and clap and I think this save can be achieved with less noise (e.g. having to republish crates etc.)
Also bare in mind that we solved most of the annoyances of the original issue but it was not properly documented (which is my bad). Eg. we removed the dependencies on openssl and libgit.
What is that rule ? This is the first time I hear of it. Also, I'm unclear on how it is violated if it wasn't before since I didn't move any test, only changed paths to make them work with the new layout.
I'm not really doing this for dependencies, though I certainly think having a clear cut separation is good, I'm doing this for separation of concerns: the CLI shouldn't have access at all to anything private in the lib and with a workspace that's very clear.
Cargo always download all the deps, regardless of specified target/features (to make offline builds much easier but also because it can't resolve final features before downloading all crates) so having two crates is effectively the only way to ensure
Even then, I still prefer workspaces to a single monolithic crate |
Regarding the "no-i-rule" (sorry I should have elaborated yesterday), I am specifically referring to the fact that:
Some links for the above:
FWIW I'm nitpicky here but I do think that this is important nonetheless. |
Well, this was my concern: I agree that this setup is an alternative way of structuring the repository but if it has no immediate purpose for users I would prefer to invest efforts into meaningful improvements, like documentation, bug fixes or feature development over endless refactoring the code base in an idempotent way. I'm not trying to cut you down here but I am concerned about a few things that the nature of your changes entail:
All of the above are pain points without a clear user focused benefit. The initial issue this pr is referring to (#140) is essentially already solved to a good portion and as you said untouched by the change. I get the fact that our personal opinions differ here but I would just urge the point that it is unsatisfying to ship changes that don't do anything and create a lot of work. |
I still don't see how that rule is broken now if it wasn't before since I just moved an already existing Regarding the rest I highly disagree that it's useless. I would even argue that non-workspaced crates should be banned in non-learning projects that are intended to grow because it causes endless pains in the Anyway, we'll have to agree to disagree on (dis)advantages, no need to rehash them back and forth for 10 more comments ^^ |
This builds on #240 to extract a
buffrs-core
crate.This allows separating what we want as CLI vs what we want as a lib clearly and makes tests clearer IMO by separating CLI/E2E tests from API tests
It also makes separating deps easier