mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
4a1a0d6284
Summary: The Rust Thrift implementation presently compiles to 4 crates: ```lang=mermaid flowchart TD; foo --> foo-clients; foo --> foo-types; foo --> foo-services; foo-clients --> foo-types; foo-services --> foo-types; ``` Sadly, the one with the best name is the most useless. That top-level foo crate just contains the following: ``` pub use ::foo_types as types; pub use ::foo_clients as client; pub use ::foo_services as server; pub use ::foo_types::consts; pub use ::foo_types::errors; pub use ::foo_types::services; pub use ::foo_clients::mock; pub use self::consts::*; pub use self::errors::*; pub use self::types::*; ``` Furthermore, it is extremely uncommon for anything to want to be both a client and a server of the *same* Thrift interface. It arises occasionally for proxies, but otherwise you are either implementing the server for a particular service, or accessing it as a client, not both. I am interested in eliminating the useless crate, and renaming the types subcrate to the nice name. ```lang=mermaid flowchart TD; foo-clients --> foo; foo-services --> foo; ``` ### Implementation plan 1. This diff 2. Migrate everything that uses `:foo-rust` and needs a client to `:foo-rust-clients`, and everything that needs a server to `:foo-rust-services` -- after this point, everything still depending on `:foo-rust` only uses types 3. In the macros, atomically delete `:foo-rust` and rename `:foo-rust-types` into its place (this will be a small diff) Reviewed By: zertosh, shayne-fletcher Differential Revision: D53302058 fbshipit-source-id: 8d28c90f3a13e71e0cedd3ce3c1cb6fe40cffe27 |
||
---|---|---|
.. | ||
clients | ||
oss | ||
services | ||
test | ||
thrift_streaming | ||
types | ||
.gitignore | ||
Cargo.toml | ||
CMakeLists.txt | ||
eden.thrift | ||
EdenCPUThreadPool.cpp | ||
EdenCPUThreadPool.h | ||
EdenInit.cpp | ||
EdenInit.h | ||
EdenMain.cpp | ||
EdenMain.h | ||
EdenServer.cpp | ||
EdenServer.h | ||
EdenServiceHandler.cpp | ||
EdenServiceHandler.h | ||
EdenStateDir.cpp | ||
EdenStateDir.h | ||
PeriodicTask.cpp | ||
PeriodicTask.h | ||
PrettyPrinters.cpp | ||
PrettyPrinters.h | ||
PrivHelperMain.cpp | ||
StartupLogger.cpp | ||
StartupLogger.h | ||
StartupStatusSubscriber.cpp | ||
StartupStatusSubscriber.h | ||
streamingeden.thrift | ||
TARGETS | ||
thrift_build.rs | ||
thrift_lib.rs | ||
ThriftGetObjectImpl.cpp | ||
ThriftGetObjectImpl.h | ||
ThriftGlobImpl.cpp | ||
ThriftGlobImpl.h | ||
ThriftPermissionChecker.cpp | ||
ThriftPermissionChecker.h | ||
ThriftStreamStartupStatusSubscriber.cpp | ||
ThriftStreamStartupStatusSubscriber.h | ||
ThriftUtil.cpp | ||
ThriftUtil.h | ||
UsageService.cpp | ||
UsageService.h |