splitting client and project into core and gui crates for headless #13475
Unanswered
skewballfox
asked this question in
General Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
One of the stretch issues on the linux preview roadmap was the number of gui libraries required for headless mode.
when looking at the output of
cargo tree
it seems that the gui related libraries are being pulled in by client and project.A (relatively) straightforward way of dealing with this is to split out all the shared functionality into a core crate(
client-core
,project-core
). This would cut out the gui dependencies for headless mode and probably reduce the number of non-gui but still unnecessary dependencies.I'm working on something similar in another project for a completely different reason, and there are likely a few code changes that would need to be made.
One issue I'm aware of is you can't implement anything directly on external structs, and you can't implement external traits on external structs. Generally though you can just wrap the external struct in a unit struct and use that throughout the project. Though fair warning, during the initial split rust analyzer and clippy are going to be rather noisy because this seems to make loading some std methods to fail(I was getting a couple hundred lines of no such method for strings, vectors and slices)
Beta Was this translation helpful? Give feedback.
All reactions