-
Notifications
You must be signed in to change notification settings - Fork 455
RFC: more fine grained crate structure #6284
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
Comments
I would sorta like it if the |
I don't think there's much of a practical difference in the short term. You have to depend on But, I also think it's better to just split up the crates slowly in big chunky pieces and not break them down too far at the beginning. That's just my gut feeling, though. |
The arrows make it look circular, which I doubt you intended. |
I think the arrow to "jj (binary)" is inverted (or is test dependency?)
I don't think we need to split |
I generally like the idea, yet think its still to early to split |
nit: It's used in many other places too ( |
One of the things I've been thinking about for a bit is something along the lines of restructuring the crate graph to look like this (an arrow A -> B means A depends on B):
Red boxes are our libraries. Green boxes are backend crates that:
Backend
implcli
extension so that their commands can be added to the resulting binaryTherefore, backends need both
jj-lib
andjj-cli
in order to compile, and those are then finally linked into the binary too. I think this makes sense: a backend crate needs to provide all the functionality for the backend, from storage to UX.I think a crate structure like this will be nicer overall in the long term because it can (hopefully) reduce some compile times, and it will also split up the dependency tree to be a bit more fine grained e.g. there is a requirement for
blake2
injj-lib
, but only forSimpleBackend
, while in the above diagram we could move that a layer below and into thesimplebackend
crate.We could then even think about adding some more boxes and arrows to the above diagram to make things more exciting. But I think this is probably the first "big" restructuring we would need.
There are a couple things standing in the way of this, but I think the biggest roadblock is: how do we test this stuff? We need to restructure the test setup a bit.
#[test]
blocks, which exist insidejj-lib
now and are finejj-lib
in some way so that they can be used in downstream testsuites?jj-git-backend
crate.jj-lib
crate usestestutils
that has a hardcoded enum that describes what backend is in use when it constructs aTestEnvironment
, IIRC. This means that we currently cannot move the Git backend out of thejj-lib
crate and push it downward. This needs to be reworked completely, but I haven't thought much of it.I'm interested in some other thoughts here, especially from Yuya since this has brushed up on a few PRs we did before. /cc @jj-vcs/maintainers
The text was updated successfully, but these errors were encountered: