diff --git a/.gitignore b/.gitignore index b693d09..a9695ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/java/build build/java/.gradle .idea -build/rust/target \ No newline at end of file +build/rust/target +build/rust/src/internal/* \ No newline at end of file diff --git a/build/rust/Cargo.lock b/build/rust/Cargo.lock index 0743619..ee7efc6 100644 --- a/build/rust/Cargo.lock +++ b/build/rust/Cargo.lock @@ -51,7 +51,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -62,7 +62,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -151,6 +151,12 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.6.1" @@ -159,9 +165,9 @@ checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cc" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" [[package]] name = "cfg-if" @@ -572,7 +578,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -589,9 +595,13 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "2288c0e17cc8d342c712bb43a257a80ebffce59cdb33d5000d8348f3ec02528b" +dependencies = [ + "zerocopy", + "zerocopy-derive", +] [[package]] name = "prettyplease" @@ -600,7 +610,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -639,7 +649,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.71", + "syn 2.0.72", "tempfile", ] @@ -653,7 +663,7 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -794,16 +804,17 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -846,9 +857,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -881,9 +892,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.39.1" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", @@ -903,7 +914,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -970,7 +981,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1024,7 +1035,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1154,3 +1165,24 @@ name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] diff --git a/build/rust/Cargo.toml b/build/rust/Cargo.toml index 2f6d14e..124fd21 100644 --- a/build/rust/Cargo.toml +++ b/build/rust/Cargo.toml @@ -6,6 +6,7 @@ description = "The rust crate for the internal gRPC communication of Code0" repository = "https://github.com/code0-tech/tucana" homepage = "https://code0.tech" license = "Apache-2.0" +include = ["src/internal/*"] [dependencies] tonic = "0.12.1" diff --git a/build/rust/build.rs b/build/rust/build.rs index 276dae3..f57e9ad 100644 --- a/build/rust/build.rs +++ b/build/rust/build.rs @@ -1,15 +1,8 @@ use std::io::Result; fn main() -> Result<()> { - let paths = &[ - "flow.proto", - "node.proto", - "rule.proto", - "type.proto", - "variable.proto" - ]; - tonic_build::configure() + .out_dir("src/internal") .build_server(true) .build_client(true) .type_attribute("Variable", "#[derive(serde::Serialize, serde::Deserialize)]") @@ -19,7 +12,13 @@ fn main() -> Result<()> { .type_attribute("Parameter", "#[derive(serde::Serialize, serde::Deserialize)]") .type_attribute("Node", "#[derive(serde::Serialize, serde::Deserialize)]") .type_attribute("Flow", "#[derive(serde::Serialize, serde::Deserialize)]") - .compile(paths, &["../../internal"]) + .compile(&[ + "variable.proto", + "rule.proto", + "type.proto", + "node.proto", + "flow.proto", + ], &["../../internal"]) .expect("Cannot compile protos"); Ok(()) diff --git a/build/rust/src/lib.rs b/build/rust/src/lib.rs index 741f39c..0e01a6e 100644 --- a/build/rust/src/lib.rs +++ b/build/rust/src/lib.rs @@ -1,3 +1,3 @@ pub mod internal { - tonic::include_proto!("internal"); + include!("internal/internal.rs"); } \ No newline at end of file