diff --git a/Cargo.lock b/Cargo.lock index 09677284fe2..1835ed3a49c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -923,6 +923,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flume" version = "0.11.0" @@ -1642,6 +1648,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "nom" version = "7.1.3" @@ -1666,6 +1678,7 @@ dependencies = [ "es-entity", "jsonwebtoken", "mongodb", + "prost 0.12.3", "rand", "reqwest", "serde", @@ -1675,6 +1688,8 @@ dependencies = [ "sqlx", "thiserror", "tokio", + "tonic 0.10.2", + "tonic-build", "tracing 0.1.0", "uuid", ] @@ -1810,11 +1825,11 @@ dependencies = [ "opentelemetry-semantic-conventions", "opentelemetry_api", "opentelemetry_sdk", - "prost", + "prost 0.11.9", "reqwest", "thiserror", "tokio", - "tonic", + "tonic 0.9.2", ] [[package]] @@ -1825,8 +1840,8 @@ checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" dependencies = [ "opentelemetry_api", "opentelemetry_sdk", - "prost", - "tonic", + "prost 0.11.9", + "tonic 0.9.2", ] [[package]] @@ -1966,6 +1981,16 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.2", +] + [[package]] name = "pin-project" version = "1.1.3" @@ -2037,6 +2062,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2063,7 +2098,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive 0.12.3", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.12.3", + "prost-types", + "regex", + "syn 2.0.48", + "tempfile", + "which", ] [[package]] @@ -2079,6 +2146,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost 0.12.3", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -3194,7 +3283,34 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing 0.1.40", +] + +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.5", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.12.3", "tokio", "tokio-stream", "tower", @@ -3203,6 +3319,19 @@ dependencies = [ "tracing 0.1.40", ] +[[package]] +name = "tonic-build" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn 2.0.48", +] + [[package]] name = "tower" version = "0.4.13" @@ -3664,6 +3793,18 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "whoami" version = "1.4.1" diff --git a/Cargo.toml b/Cargo.toml index b19b8ae4419..d6d00d2554d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,3 +38,5 @@ opentelemetry = { version = "0.20.0", features = ["trace", "rt-tokio"]} opentelemetry-semantic-conventions = "0.12.0" opentelemetry-http = "0.9.0" http = "0.2.9" +tonic = "0.10.2" +prost = "0.12" diff --git a/core/notifications/BUCK b/core/notifications/BUCK index fe243964c0d..53d5b054b76 100644 --- a/core/notifications/BUCK +++ b/core/notifications/BUCK @@ -66,6 +66,9 @@ rust_library( "//third-party/rust:rand", "//third-party/rust:uuid", "//third-party/rust:serde_with", + "//third-party/rust:prost", + "//third-party/rust:tonic", + "//third-party/rust:tonic-build", ], srcs = glob([ "src/**/*.rs", @@ -75,7 +78,7 @@ rust_library( ]), env = { "CARGO_MANIFEST_DIR": ".", - "SQLX_OFFLINE": "true", + "SQLX_OFFLINE": "true" } ) diff --git a/core/notifications/Cargo.toml b/core/notifications/Cargo.toml index b97ed2eb823..f98cf9fe528 100644 --- a/core/notifications/Cargo.toml +++ b/core/notifications/Cargo.toml @@ -37,3 +37,8 @@ mongodb = { workspace = true } rand = { workspace = true } uuid = { workspace = true } serde_with = { workspace = true } +tonic = { workspace = true } +prost = { workspace = true } + +[build-dependencies] +tonic-build = { version = "0.10.2", features = ["prost"] } diff --git a/core/notifications/build.rs b/core/notifications/build.rs new file mode 100644 index 00000000000..2b6043a5e76 --- /dev/null +++ b/core/notifications/build.rs @@ -0,0 +1,7 @@ +fn main() -> Result<(), Box> { + println!("cargo:rerun-if-changed=migrations"); + + // std::env::set_var("PROTOC", protobuf_src::protoc()); + tonic_build::configure().compile(&["proto/notifications.proto"], &["proto"])?; + Ok(()) +} diff --git a/core/notifications/proto/notifications.proto b/core/notifications/proto/notifications.proto new file mode 100644 index 00000000000..4f49dc208ee --- /dev/null +++ b/core/notifications/proto/notifications.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package helloworld; + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) {} +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// The response message containing the greetings. +message HelloReply { + string message = 1; +} + diff --git a/core/notifications/src/lib.rs b/core/notifications/src/lib.rs index a24ec76694c..a444acaf58b 100644 --- a/core/notifications/src/lib.rs +++ b/core/notifications/src/lib.rs @@ -8,3 +8,8 @@ mod primitives; pub mod cli; pub mod graphql; + +#[allow(clippy::all)] +pub mod proto { + tonic::include_proto!("helloworld"); +} diff --git a/flake.nix b/flake.nix index 0da7bdda58a..92f6af05e0a 100644 --- a/flake.nix +++ b/flake.nix @@ -71,6 +71,7 @@ cargo-watch reindeer gitMinimal + protobuf ] ++ buck2NativeBuildInputs ++ lib.optionals pkgs.stdenv.isLinux [ diff --git a/third-party/rust/BUCK b/third-party/rust/BUCK index de0470b96d0..1f57072f465 100644 --- a/third-party/rust/BUCK +++ b/third-party/rust/BUCK @@ -2108,6 +2108,23 @@ cargo.rust_library( visibility = [], ) +http_archive( + name = "fixedbitset-0.4.2.crate", + sha256 = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80", + strip_prefix = "fixedbitset-0.4.2", + urls = ["https://crates.io/api/v1/crates/fixedbitset/0.4.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "fixedbitset-0.4.2", + srcs = [":fixedbitset-0.4.2.crate"], + crate = "fixedbitset", + crate_root = "fixedbitset-0.4.2.crate/src/lib.rs", + edition = "2015", + visibility = [], +) + http_archive( name = "flume-0.11.0.crate", sha256 = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181", @@ -3264,7 +3281,11 @@ cargo.rust_library( crate = "itertools", crate_root = "itertools-0.10.5.crate/src/lib.rs", edition = "2018", - features = ["use_alloc"], + features = [ + "default", + "use_alloc", + "use_std", + ], visibility = [], deps = [":either-1.9.0"], ) @@ -3915,6 +3936,23 @@ cargo.rust_library( ], ) +http_archive( + name = "multimap-0.8.3.crate", + sha256 = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a", + strip_prefix = "multimap-0.8.3", + urls = ["https://crates.io/api/v1/crates/multimap/0.8.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "multimap-0.8.3", + srcs = [":multimap-0.8.3.crate"], + crate = "multimap", + crate_root = "multimap-0.8.3.crate/src/lib.rs", + edition = "2015", + visibility = [], +) + http_archive( name = "nom-7.1.3.crate", sha256 = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a", @@ -4771,6 +4809,27 @@ cargo.rust_library( ], ) +http_archive( + name = "petgraph-0.6.4.crate", + sha256 = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9", + strip_prefix = "petgraph-0.6.4", + urls = ["https://crates.io/api/v1/crates/petgraph/0.6.4/download"], + visibility = [], +) + +cargo.rust_library( + name = "petgraph-0.6.4", + srcs = [":petgraph-0.6.4.crate"], + crate = "petgraph", + crate_root = "petgraph-0.6.4.crate/src/lib.rs", + edition = "2018", + visibility = [], + deps = [ + ":fixedbitset-0.4.2", + ":indexmap-2.0.2", + ], +) + http_archive( name = "pin-project-1.1.3.crate", sha256 = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422", @@ -4956,6 +5015,27 @@ cargo.rust_library( visibility = [], ) +http_archive( + name = "prettyplease-0.2.16.crate", + sha256 = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5", + strip_prefix = "prettyplease-0.2.16", + urls = ["https://crates.io/api/v1/crates/prettyplease/0.2.16/download"], + visibility = [], +) + +cargo.rust_library( + name = "prettyplease-0.2.16", + srcs = [":prettyplease-0.2.16.crate"], + crate = "prettyplease", + crate_root = "prettyplease-0.2.16.crate/src/lib.rs", + edition = "2021", + visibility = [], + deps = [ + ":proc-macro2-1.0.76", + ":syn-2.0.48", + ], +) + http_archive( name = "proc-macro-crate-1.3.1.crate", sha256 = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919", @@ -5024,6 +5104,38 @@ buildscript_run( version = "1.0.76", ) +alias( + name = "prost", + actual = ":prost-0.10.4", + visibility = ["PUBLIC"], +) + +http_archive( + name = "prost-0.10.4.crate", + sha256 = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e", + strip_prefix = "prost-0.10.4", + urls = ["https://crates.io/api/v1/crates/prost/0.10.4/download"], + visibility = [], +) + +cargo.rust_library( + name = "prost-0.10.4", + srcs = [":prost-0.10.4.crate"], + crate = "prost", + crate_root = "prost-0.10.4.crate/src/lib.rs", + edition = "2018", + features = [ + "default", + "prost-derive", + "std", + ], + visibility = [], + deps = [ + ":bytes-1.5.0", + ":prost-derive-0.10.1", + ], +) + http_archive( name = "prost-0.11.9.crate", sha256 = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd", @@ -5050,6 +5162,95 @@ cargo.rust_library( ], ) +http_archive( + name = "prost-0.12.3.crate", + sha256 = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a", + strip_prefix = "prost-0.12.3", + urls = ["https://crates.io/api/v1/crates/prost/0.12.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "prost-0.12.3", + srcs = [":prost-0.12.3.crate"], + crate = "prost", + crate_root = "prost-0.12.3.crate/src/lib.rs", + edition = "2021", + features = [ + "prost-derive", + "std", + ], + visibility = [], + deps = [ + ":bytes-1.5.0", + ":prost-derive-0.12.3", + ], +) + +http_archive( + name = "prost-build-0.12.3.crate", + sha256 = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2", + strip_prefix = "prost-build-0.12.3", + urls = ["https://crates.io/api/v1/crates/prost-build/0.12.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "prost-build-0.12.3", + srcs = [":prost-build-0.12.3.crate"], + crate = "prost_build", + crate_root = "prost-build-0.12.3.crate/src/lib.rs", + edition = "2021", + features = [ + "default", + "format", + "prettyplease", + "syn", + ], + visibility = [], + deps = [ + ":bytes-1.5.0", + ":heck-0.4.1", + ":itertools-0.11.0", + ":log-0.4.20", + ":multimap-0.8.3", + ":once_cell-1.18.0", + ":petgraph-0.6.4", + ":prettyplease-0.2.16", + ":prost-0.12.3", + ":prost-types-0.12.3", + ":regex-1.10.2", + ":syn-2.0.48", + ":tempfile-3.8.1", + ":which-4.4.2", + ], +) + +http_archive( + name = "prost-derive-0.10.1.crate", + sha256 = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc", + strip_prefix = "prost-derive-0.10.1", + urls = ["https://crates.io/api/v1/crates/prost-derive/0.10.1/download"], + visibility = [], +) + +cargo.rust_library( + name = "prost-derive-0.10.1", + srcs = [":prost-derive-0.10.1.crate"], + crate = "prost_derive", + crate_root = "prost-derive-0.10.1.crate/src/lib.rs", + edition = "2018", + proc_macro = True, + visibility = [], + deps = [ + ":anyhow-1.0.79", + ":itertools-0.10.5", + ":proc-macro2-1.0.76", + ":quote-1.0.35", + ":syn-1.0.109", + ], +) + http_archive( name = "prost-derive-0.11.9.crate", sha256 = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4", @@ -5075,6 +5276,49 @@ cargo.rust_library( ], ) +http_archive( + name = "prost-derive-0.12.3.crate", + sha256 = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e", + strip_prefix = "prost-derive-0.12.3", + urls = ["https://crates.io/api/v1/crates/prost-derive/0.12.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "prost-derive-0.12.3", + srcs = [":prost-derive-0.12.3.crate"], + crate = "prost_derive", + crate_root = "prost-derive-0.12.3.crate/src/lib.rs", + edition = "2021", + proc_macro = True, + visibility = [], + deps = [ + ":anyhow-1.0.79", + ":itertools-0.11.0", + ":proc-macro2-1.0.76", + ":quote-1.0.35", + ":syn-2.0.48", + ], +) + +http_archive( + name = "prost-types-0.12.3.crate", + sha256 = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e", + strip_prefix = "prost-types-0.12.3", + urls = ["https://crates.io/api/v1/crates/prost-types/0.12.3/download"], + visibility = [], +) + +cargo.rust_library( + name = "prost-types-0.12.3", + srcs = [":prost-types-0.12.3.crate"], + crate = "prost_types", + crate_root = "prost-types-0.12.3.crate/src/lib.rs", + edition = "2021", + visibility = [], + deps = [":prost-0.12.3"], +) + http_archive( name = "quick-error-1.2.3.crate", sha256 = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0", @@ -8082,6 +8326,7 @@ cargo.rust_binary( ":opentelemetry-http-0.9.0", ":opentelemetry-otlp-0.13.0", ":opentelemetry-semantic-conventions-0.12.0", + ":prost-0.10.4", ":rand-0.8.5", ":reqwest-0.11.23", ":serde-1.0.195", @@ -8091,6 +8336,8 @@ cargo.rust_binary( ":sqlx-0.7.2", ":thiserror-1.0.50", ":tokio-1.33.0", + ":tonic-0.10.2", + ":tonic-build-0.10.2", ":tracing-0.1.40", ":tracing-opentelemetry-0.20.0", ":tracing-subscriber-0.3.18", @@ -8583,6 +8830,68 @@ cargo.rust_library( ], ) +alias( + name = "tonic", + actual = ":tonic-0.10.2", + visibility = ["PUBLIC"], +) + +http_archive( + name = "tonic-0.10.2.crate", + sha256 = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e", + strip_prefix = "tonic-0.10.2", + urls = ["https://crates.io/api/v1/crates/tonic/0.10.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "tonic-0.10.2", + srcs = [":tonic-0.10.2.crate"], + crate = "tonic", + crate_root = "tonic-0.10.2.crate/src/lib.rs", + edition = "2021", + env = { + "CARGO_MANIFEST_DIR": "tonic-0.10.2.crate", + "CARGO_PKG_AUTHORS": "Lucio Franco ", + "CARGO_PKG_DESCRIPTION": "A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.\n", + "CARGO_PKG_NAME": "tonic", + "CARGO_PKG_REPOSITORY": "https://github.com/hyperium/tonic", + "CARGO_PKG_VERSION": "0.10.2", + "CARGO_PKG_VERSION_MAJOR": "0", + "CARGO_PKG_VERSION_MINOR": "10", + "CARGO_PKG_VERSION_PATCH": "2", + }, + features = [ + "channel", + "codegen", + "default", + "prost", + "transport", + ], + visibility = [], + deps = [ + ":async-stream-0.3.5", + ":async-trait-0.1.74", + ":axum-0.6.20", + ":base64-0.21.5", + ":bytes-1.5.0", + ":h2-0.3.21", + ":http-0.2.9", + ":http-body-0.4.5", + ":hyper-0.14.27", + ":hyper-timeout-0.4.1", + ":percent-encoding-2.3.0", + ":pin-project-1.1.3", + ":prost-0.12.3", + ":tokio-1.33.0", + ":tokio-stream-0.1.14", + ":tower-0.4.13", + ":tower-layer-0.3.2", + ":tower-service-0.3.2", + ":tracing-0.1.40", + ], +) + http_archive( name = "tonic-0.9.2.crate", sha256 = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a", @@ -8640,6 +8949,42 @@ cargo.rust_library( ], ) +alias( + name = "tonic-build", + actual = ":tonic-build-0.10.2", + visibility = ["PUBLIC"], +) + +http_archive( + name = "tonic-build-0.10.2.crate", + sha256 = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889", + strip_prefix = "tonic-build-0.10.2", + urls = ["https://crates.io/api/v1/crates/tonic-build/0.10.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "tonic-build-0.10.2", + srcs = [":tonic-build-0.10.2.crate"], + crate = "tonic_build", + crate_root = "tonic-build-0.10.2.crate/src/lib.rs", + edition = "2021", + features = [ + "default", + "prost", + "prost-build", + "transport", + ], + visibility = [], + deps = [ + ":prettyplease-0.2.16", + ":proc-macro2-1.0.76", + ":prost-build-0.12.3", + ":quote-1.0.35", + ":syn-2.0.48", + ], +) + http_archive( name = "tower-0.4.13.crate", sha256 = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c", @@ -9584,6 +9929,53 @@ cargo.rust_library( visibility = [], ) +http_archive( + name = "which-4.4.2.crate", + sha256 = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7", + strip_prefix = "which-4.4.2", + urls = ["https://crates.io/api/v1/crates/which/4.4.2/download"], + visibility = [], +) + +cargo.rust_library( + name = "which-4.4.2", + srcs = [":which-4.4.2.crate"], + crate = "which", + crate_root = "which-4.4.2.crate/src/lib.rs", + edition = "2021", + platform = { + "linux-arm64": dict( + deps = [":home-0.5.5"], + ), + "linux-x86_64": dict( + deps = [":home-0.5.5"], + ), + "macos-arm64": dict( + deps = [":home-0.5.5"], + ), + "macos-x86_64": dict( + deps = [":home-0.5.5"], + ), + "windows-gnu": dict( + deps = [ + ":home-0.5.5", + ":once_cell-1.18.0", + ], + ), + "windows-msvc": dict( + deps = [ + ":home-0.5.5", + ":once_cell-1.18.0", + ], + ), + }, + visibility = [], + deps = [ + ":either-1.9.0", + ":rustix-0.38.21", + ], +) + http_archive( name = "whoami-1.4.1.crate", sha256 = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50", diff --git a/third-party/rust/Cargo.lock b/third-party/rust/Cargo.lock index 7c3f92e7ec4..540c14ad9f4 100644 --- a/third-party/rust/Cargo.lock +++ b/third-party/rust/Cargo.lock @@ -886,6 +886,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flume" version = "0.11.0" @@ -1605,6 +1611,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "nom" version = "7.1.3" @@ -1746,11 +1758,11 @@ dependencies = [ "opentelemetry-semantic-conventions", "opentelemetry_api", "opentelemetry_sdk", - "prost", + "prost 0.11.9", "reqwest", "thiserror", "tokio", - "tonic", + "tonic 0.9.2", ] [[package]] @@ -1761,8 +1773,8 @@ checksum = "b1e3f814aa9f8c905d0ee4bde026afd3b2577a97c10e1699912e3e44f0c4cbeb" dependencies = [ "opentelemetry_api", "opentelemetry_sdk", - "prost", - "tonic", + "prost 0.11.9", + "tonic 0.9.2", ] [[package]] @@ -1902,6 +1914,16 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.0.2", +] + [[package]] name = "pin-project" version = "1.1.3" @@ -1973,6 +1995,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.48", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -1992,6 +2024,16 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prost" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +dependencies = [ + "bytes", + "prost-derive 0.10.1", +] + [[package]] name = "prost" version = "0.11.9" @@ -1999,7 +2041,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive 0.12.3", +] + +[[package]] +name = "prost-build" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +dependencies = [ + "bytes", + "heck", + "itertools 0.11.0", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.12.3", + "prost-types", + "regex", + "syn 2.0.48", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -2015,6 +2102,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost 0.12.3", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -2950,6 +3059,7 @@ dependencies = [ "opentelemetry-http", "opentelemetry-otlp", "opentelemetry-semantic-conventions", + "prost 0.10.4", "rand", "reqwest", "serde", @@ -2959,6 +3069,8 @@ dependencies = [ "sqlx", "thiserror", "tokio", + "tonic 0.10.2", + "tonic-build", "tracing", "tracing-opentelemetry", "tracing-subscriber", @@ -3164,7 +3276,34 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.5", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.12.3", "tokio", "tokio-stream", "tower", @@ -3173,6 +3312,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic-build" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn 2.0.48", +] + [[package]] name = "tower" version = "0.4.13" @@ -3618,6 +3770,18 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "whoami" version = "1.4.1" diff --git a/third-party/rust/Cargo.toml b/third-party/rust/Cargo.toml index c35562049e1..3ead22e3242 100644 --- a/third-party/rust/Cargo.toml +++ b/third-party/rust/Cargo.toml @@ -47,4 +47,8 @@ opentelemetry-semantic-conventions = "0.12.0" opentelemetry-http = "0.9.0" http = "0.2.9" +prost = "0.10.2" +tonic = "0.10.2" +tonic-build = { version = "0.10.2", features = ["prost"] } + version_check = "0.9.4" # for some reason reindeer didn't auto-add this diff --git a/third-party/rust/fixups/prettyplease/fixups.toml b/third-party/rust/fixups/prettyplease/fixups.toml new file mode 100644 index 00000000000..db40d72cb2e --- /dev/null +++ b/third-party/rust/fixups/prettyplease/fixups.toml @@ -0,0 +1 @@ +buildscript = []