diff --git a/eden/fs/Cargo.toml b/eden/fs/Cargo.toml index ab0d7655ce75e..2679bb6d3a413 100644 --- a/eden/fs/Cargo.toml +++ b/eden/fs/Cargo.toml @@ -55,10 +55,10 @@ members = [ "inodes/overlay/services", "rust/edenfs-asserted-states", "rust/redirect_ffi", - "service", - "service/clients", - "service/mocks", - "service/services", + "service/thrift", + "service/thrift/clients", + "service/thrift/mocks", + "service/thrift/services", "service/thrift_streaming", "service/thrift_streaming/clients", "service/thrift_streaming/mocks", diff --git a/eden/fs/service/BUCK b/eden/fs/service/BUCK index 47a9b23f1c12f..dae12d56840b5 100644 --- a/eden/fs/service/BUCK +++ b/eden/fs/service/BUCK @@ -483,6 +483,7 @@ thrift_library( "py-deprecated", ], py_base_module = "facebook", + rust_autocargo = {"cargo_toml_dir": "thrift"}, rust_deps = [ "//common/rust/shed/sorted_vector_map:sorted_vector_map", ], diff --git a/eden/fs/service/Cargo.toml b/eden/fs/service/thrift/Cargo.toml similarity index 96% rename from eden/fs/service/Cargo.toml rename to eden/fs/service/thrift/Cargo.toml index 75fcf51c08cff..1b7458fbdf50b 100644 --- a/eden/fs/service/Cargo.toml +++ b/eden/fs/service/thrift/Cargo.toml @@ -17,7 +17,7 @@ doc = false [dependencies] anyhow = "1.0.98" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } -config_thrift = { version = "0.1.0", path = "../config" } +config_thrift = { version = "0.1.0", path = "../../config" } cpp = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } fb303_core = { version = "0.0.0", git = "https://github.com/facebook/fb303.git", branch = "main" } fbthrift = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } diff --git a/eden/fs/service/clients/Cargo.toml b/eden/fs/service/thrift/clients/Cargo.toml similarity index 92% rename from eden/fs/service/clients/Cargo.toml rename to eden/fs/service/thrift/clients/Cargo.toml index 9709396aaf1da..b41dad99ba854 100644 --- a/eden/fs/service/clients/Cargo.toml +++ b/eden/fs/service/thrift/clients/Cargo.toml @@ -18,8 +18,8 @@ doc = false anyhow = "1.0.98" async-trait = "0.1.86" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } -config_thrift = { version = "0.1.0", path = "../../config" } -config_thrift_clients = { version = "0.1.0", path = "../../config/clients" } +config_thrift = { version = "0.1.0", path = "../../../config" } +config_thrift_clients = { version = "0.1.0", path = "../../../config/clients" } cpp = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } cpp_clients = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } fb303_core = { version = "0.0.0", git = "https://github.com/facebook/fb303.git", branch = "main" } diff --git a/eden/fs/service/clients/thrift_build.rs b/eden/fs/service/thrift/clients/thrift_build.rs similarity index 94% rename from eden/fs/service/clients/thrift_build.rs rename to eden/fs/service/thrift/clients/thrift_build.rs index 204435cb5dba0..0caaa7cba8c8f 100644 --- a/eden/fs/service/clients/thrift_build.rs +++ b/eden/fs/service/thrift/clients/thrift_build.rs @@ -22,10 +22,10 @@ fn main() { fs::write(cratemap_path, CRATEMAP).expect("Failed to write cratemap"); Config::from_env(GenContext::Clients) .expect("Failed to instantiate thrift_compiler::Config") - .base_path("../../../..") + .base_path("../../../../..") .types_crate("thrift__types") .clients_crate("thrift__clients") .options("deprecated_default_enum_min_i32") - .run(["../eden.thrift"]) + .run(["../../eden.thrift"]) .expect("Failed while running thrift compilation"); } diff --git a/eden/fs/service/clients/thrift_lib.rs b/eden/fs/service/thrift/clients/thrift_lib.rs similarity index 100% rename from eden/fs/service/clients/thrift_lib.rs rename to eden/fs/service/thrift/clients/thrift_lib.rs diff --git a/eden/fs/service/mocks/Cargo.toml b/eden/fs/service/thrift/mocks/Cargo.toml similarity index 91% rename from eden/fs/service/mocks/Cargo.toml rename to eden/fs/service/thrift/mocks/Cargo.toml index 1f0958302a041..1751db9a71e8f 100644 --- a/eden/fs/service/mocks/Cargo.toml +++ b/eden/fs/service/thrift/mocks/Cargo.toml @@ -18,9 +18,9 @@ doc = false anyhow = "1.0.98" async-trait = "0.1.86" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } -config_thrift = { version = "0.1.0", path = "../../config" } -config_thrift_clients = { version = "0.1.0", path = "../../config/clients" } -config_thrift_mocks = { version = "0.1.0", path = "../../config/mocks" } +config_thrift = { version = "0.1.0", path = "../../../config" } +config_thrift_clients = { version = "0.1.0", path = "../../../config/clients" } +config_thrift_mocks = { version = "0.1.0", path = "../../../config/mocks" } cpp = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } cpp_clients = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } cpp_mocks = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } diff --git a/eden/fs/service/thrift_build.rs b/eden/fs/service/thrift/mocks/thrift_build.rs similarity index 91% rename from eden/fs/service/thrift_build.rs rename to eden/fs/service/thrift/mocks/thrift_build.rs index 9b96f1329f821..861d24a9b1acc 100644 --- a/eden/fs/service/thrift_build.rs +++ b/eden/fs/service/thrift/mocks/thrift_build.rs @@ -20,12 +20,12 @@ fn main() { let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR env not provided"); let cratemap_path = Path::new(&out_dir).join("cratemap"); fs::write(cratemap_path, CRATEMAP).expect("Failed to write cratemap"); - Config::from_env(GenContext::Types) + Config::from_env(GenContext::Mocks) .expect("Failed to instantiate thrift_compiler::Config") - .base_path("../../..") + .base_path("../../../../..") .types_crate("thrift__types") .clients_crate("thrift__clients") .options("deprecated_default_enum_min_i32") - .run(["eden.thrift"]) + .run(["../../eden.thrift"]) .expect("Failed while running thrift compilation"); } diff --git a/eden/fs/service/mocks/thrift_lib.rs b/eden/fs/service/thrift/mocks/thrift_lib.rs similarity index 100% rename from eden/fs/service/mocks/thrift_lib.rs rename to eden/fs/service/thrift/mocks/thrift_lib.rs diff --git a/eden/fs/service/services/Cargo.toml b/eden/fs/service/thrift/services/Cargo.toml similarity index 92% rename from eden/fs/service/services/Cargo.toml rename to eden/fs/service/thrift/services/Cargo.toml index aae86f22bdc8f..46f27da349188 100644 --- a/eden/fs/service/services/Cargo.toml +++ b/eden/fs/service/thrift/services/Cargo.toml @@ -18,8 +18,8 @@ doc = false anyhow = "1.0.98" async-trait = "0.1.86" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } -config_thrift = { version = "0.1.0", path = "../../config" } -config_thrift_services = { version = "0.1.0", path = "../../config/services" } +config_thrift = { version = "0.1.0", path = "../../../config" } +config_thrift_services = { version = "0.1.0", path = "../../../config/services" } cpp = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } cpp_services = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } fb303_core = { version = "0.0.0", git = "https://github.com/facebook/fb303.git", branch = "main" } diff --git a/eden/fs/service/services/thrift_build.rs b/eden/fs/service/thrift/services/thrift_build.rs similarity index 94% rename from eden/fs/service/services/thrift_build.rs rename to eden/fs/service/thrift/services/thrift_build.rs index 7ea8ab0bb80af..5604f44fd86f3 100644 --- a/eden/fs/service/services/thrift_build.rs +++ b/eden/fs/service/thrift/services/thrift_build.rs @@ -22,10 +22,10 @@ fn main() { fs::write(cratemap_path, CRATEMAP).expect("Failed to write cratemap"); Config::from_env(GenContext::Services) .expect("Failed to instantiate thrift_compiler::Config") - .base_path("../../../..") + .base_path("../../../../..") .types_crate("thrift__types") .clients_crate("thrift__clients") .options("deprecated_default_enum_min_i32") - .run(["../eden.thrift"]) + .run(["../../eden.thrift"]) .expect("Failed while running thrift compilation"); } diff --git a/eden/fs/service/services/thrift_lib.rs b/eden/fs/service/thrift/services/thrift_lib.rs similarity index 100% rename from eden/fs/service/services/thrift_lib.rs rename to eden/fs/service/thrift/services/thrift_lib.rs diff --git a/eden/fs/service/mocks/thrift_build.rs b/eden/fs/service/thrift/thrift_build.rs similarity index 96% rename from eden/fs/service/mocks/thrift_build.rs rename to eden/fs/service/thrift/thrift_build.rs index 3b725bb8e0fd6..59eb9918072f4 100644 --- a/eden/fs/service/mocks/thrift_build.rs +++ b/eden/fs/service/thrift/thrift_build.rs @@ -20,7 +20,7 @@ fn main() { let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR env not provided"); let cratemap_path = Path::new(&out_dir).join("cratemap"); fs::write(cratemap_path, CRATEMAP).expect("Failed to write cratemap"); - Config::from_env(GenContext::Mocks) + Config::from_env(GenContext::Types) .expect("Failed to instantiate thrift_compiler::Config") .base_path("../../../..") .types_crate("thrift__types") diff --git a/eden/fs/service/thrift_lib.rs b/eden/fs/service/thrift/thrift_lib.rs similarity index 100% rename from eden/fs/service/thrift_lib.rs rename to eden/fs/service/thrift/thrift_lib.rs diff --git a/eden/fs/service/thrift_streaming/Cargo.toml b/eden/fs/service/thrift_streaming/Cargo.toml index 2a55807fb5c84..052a5ab987035 100644 --- a/eden/fs/service/thrift_streaming/Cargo.toml +++ b/eden/fs/service/thrift_streaming/Cargo.toml @@ -21,7 +21,7 @@ fbthrift = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbth futures = { version = "0.3.31", features = ["async-await", "compat"] } ref-cast = "1.0.18" thiserror = "2.0.12" -thrift__0 = { package = "thrift", version = "0.1.0", path = ".." } +thrift__0 = { package = "thrift", version = "0.1.0", path = "../thrift" } thrift__1 = { package = "thrift", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } [build-dependencies] diff --git a/eden/fs/service/thrift_streaming/clients/Cargo.toml b/eden/fs/service/thrift_streaming/clients/Cargo.toml index 4b13c56e6001d..96f004e60a69e 100644 --- a/eden/fs/service/thrift_streaming/clients/Cargo.toml +++ b/eden/fs/service/thrift_streaming/clients/Cargo.toml @@ -20,8 +20,8 @@ async-trait = "0.1.86" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } fbthrift = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } futures = { version = "0.3.31", features = ["async-await", "compat"] } -thrift__0 = { package = "thrift", version = "0.1.0", path = "../.." } -thrift__0_clients = { package = "thrift_clients", version = "0.1.0", path = "../../clients" } +thrift__0 = { package = "thrift", version = "0.1.0", path = "../../thrift" } +thrift__0_clients = { package = "thrift_clients", version = "0.1.0", path = "../../thrift/clients" } thrift__1 = { package = "thrift", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } thrift__1_clients = { package = "thrift_clients", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } thrift_streaming__types = { package = "thrift_streaming", version = "0.1.0", path = ".." } diff --git a/eden/fs/service/thrift_streaming/mocks/Cargo.toml b/eden/fs/service/thrift_streaming/mocks/Cargo.toml index 42c1a41442ef8..fea1d7678bd53 100644 --- a/eden/fs/service/thrift_streaming/mocks/Cargo.toml +++ b/eden/fs/service/thrift_streaming/mocks/Cargo.toml @@ -20,9 +20,9 @@ async-trait = "0.1.86" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } fbthrift = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } futures = { version = "0.3.31", features = ["async-await", "compat"] } -thrift__0 = { package = "thrift", version = "0.1.0", path = "../.." } -thrift__0_clients = { package = "thrift_clients", version = "0.1.0", path = "../../clients" } -thrift__0_mocks = { package = "thrift_mocks", version = "0.1.0", path = "../../mocks" } +thrift__0 = { package = "thrift", version = "0.1.0", path = "../../thrift" } +thrift__0_clients = { package = "thrift_clients", version = "0.1.0", path = "../../thrift/clients" } +thrift__0_mocks = { package = "thrift_mocks", version = "0.1.0", path = "../../thrift/mocks" } thrift__1 = { package = "thrift", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } thrift__1_clients = { package = "thrift_clients", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } thrift__1_mocks = { package = "thrift_mocks", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } diff --git a/eden/fs/service/thrift_streaming/services/Cargo.toml b/eden/fs/service/thrift_streaming/services/Cargo.toml index 8cac07c6eddef..ec2883b17b40f 100644 --- a/eden/fs/service/thrift_streaming/services/Cargo.toml +++ b/eden/fs/service/thrift_streaming/services/Cargo.toml @@ -20,8 +20,8 @@ async-trait = "0.1.86" codegen_includer_proc_macro = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" } fbthrift = { version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } futures = { version = "0.3.31", features = ["async-await", "compat"] } -thrift__0 = { package = "thrift", version = "0.1.0", path = "../.." } -thrift__0_services = { package = "thrift_services", version = "0.1.0", path = "../../services" } +thrift__0 = { package = "thrift", version = "0.1.0", path = "../../thrift" } +thrift__0_services = { package = "thrift_services", version = "0.1.0", path = "../../thrift/services" } thrift__1 = { package = "thrift", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } thrift__1_services = { package = "thrift_services", version = "0.0.1+unstable", git = "https://github.com/facebook/fbthrift.git", branch = "main" } thrift_streaming__types = { package = "thrift_streaming", version = "0.1.0", path = ".." }