Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bbe2083965 | |||
| 2979dd476e |
Generated
+1
-9
@@ -833,15 +833,6 @@ version = "0.10.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084"
|
checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "no_std_test"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"bytes",
|
|
||||||
"prost",
|
|
||||||
"roto-runtime",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num-traits"
|
name = "num-traits"
|
||||||
version = "0.2.19"
|
version = "0.2.19"
|
||||||
@@ -1186,6 +1177,7 @@ dependencies = [
|
|||||||
"http-body",
|
"http-body",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"log",
|
"log",
|
||||||
|
"roto-runtime",
|
||||||
"roto-tonic",
|
"roto-tonic",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tonic",
|
"tonic",
|
||||||
|
|||||||
+4
-2
@@ -6,13 +6,15 @@ members = [
|
|||||||
"benches",
|
"benches",
|
||||||
"roto-tonic",
|
"roto-tonic",
|
||||||
"examples/hello_world",
|
"examples/hello_world",
|
||||||
"examples/no_std_test",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
exclude = [
|
exclude = [
|
||||||
"test_gen_project"
|
"test_gen_project",
|
||||||
|
"examples/no_std_test",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
resolver = "3"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ name = "roto-benches"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
alloc = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
roto-runtime = { path = "../runtime" }
|
roto-runtime = { path = "../runtime" }
|
||||||
clap = { version = "4", features = ["derive"] }
|
clap = { version = "4", features = ["derive"] }
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ name = "roto-codegen"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
alloc = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
|
roto-runtime = { path = "../runtime" }
|
||||||
roto-tonic = { path = "../roto-tonic" }
|
roto-tonic = { path = "../roto-tonic" }
|
||||||
clap = { version = "4", features = ["derive"] }
|
clap = { version = "4", features = ["derive"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|||||||
@@ -7,19 +7,23 @@ use crate::runtime::ProtoAccessor;
|
|||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|
||||||
const DATA_IMPORTS: &str = "use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator, RotoMessage};\nuse core::str;\nuse bytes::{Bytes, BytesMut, Buf, BufMut};\n";
|
const DATA_IMPORTS: &str = "#[allow(unused)]\n\
|
||||||
const SERVICE_IMPORTS: &str = "use tonic::{Request, Response, Status};\n\
|
use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator, RotoMessage};\n\
|
||||||
use tokio_stream::Stream;\n\
|
use core::str;\n\
|
||||||
use std::pin::Pin;\n\
|
use bytes::{Bytes, BytesMut, Buf, BufMut};\n";
|
||||||
use std::sync::Arc;\n\
|
const SERVICE_IMPORTS: &str = "#[allow(unused)]\n\
|
||||||
use std::task::{Context, Poll};\n\
|
use tonic::{Request, Response, Status};\n\
|
||||||
use std::future::Future;\n\
|
use tokio_stream::Stream;\n\
|
||||||
use tonic::body::BoxBody;\n\
|
use std::pin::Pin;\n\
|
||||||
use tower::Service;\n\
|
use std::sync::Arc;\n\
|
||||||
use futures_util::StreamExt;\n\
|
use std::task::{Context, Poll};\n\
|
||||||
use http_body_util::BodyExt;\n\
|
use std::future::Future;\n\
|
||||||
use http_body::Body;\n\
|
use tonic::body::BoxBody;\n\
|
||||||
use crate::{BufferPool, StatusBody};\n";
|
use tower::Service;\n\
|
||||||
|
use futures_util::StreamExt;\n\
|
||||||
|
use http_body_util::BodyExt;\n\
|
||||||
|
use http_body::Body;\n\
|
||||||
|
use crate::{BufferPool, StatusBody};\n";
|
||||||
|
|
||||||
pub fn to_pascal_case(s: &str) -> String {
|
pub fn to_pascal_case(s: &str) -> String {
|
||||||
s.split('_')
|
s.split('_')
|
||||||
@@ -456,10 +460,7 @@ fn write_message(msg_proto: &DescriptorProto, output: &mut String) {
|
|||||||
|
|
||||||
output.push_str(&format!(" pub fn finish(self) -> roto_runtime::Result<&'b mut [u8]> {{\n self.builder.finish()\n }}\n}}\n\n"));
|
output.push_str(&format!(" pub fn finish(self) -> roto_runtime::Result<&'b mut [u8]> {{\n self.builder.finish()\n }}\n}}\n\n"));
|
||||||
|
|
||||||
output.push_str(&format!(
|
output.push_str(&format!("pub struct Owned{} {{\n", msg_name));
|
||||||
"pub struct Owned{} {{\n",
|
|
||||||
msg_name
|
|
||||||
));
|
|
||||||
output.push_str(" pub data: bytes::Bytes,\n");
|
output.push_str(" pub data: bytes::Bytes,\n");
|
||||||
output.push_str("}\n\n");
|
output.push_str("}\n\n");
|
||||||
|
|
||||||
@@ -884,7 +885,6 @@ fn write_service(svc_proto: &ServiceDescriptorProto, package: &str, output: &mut
|
|||||||
output.push_str(" pool: Arc<BufferPool>,\n");
|
output.push_str(" pool: Arc<BufferPool>,\n");
|
||||||
output.push_str("}\n\n");
|
output.push_str("}\n\n");
|
||||||
|
|
||||||
|
|
||||||
output.push_str(&format!("impl {} {{\n", server_name));
|
output.push_str(&format!("impl {} {{\n", server_name));
|
||||||
output.push_str(&format!(
|
output.push_str(&format!(
|
||||||
" pub fn new(inner: Arc<dyn {}>, pool: Arc<BufferPool>) -> Self {{\n",
|
" pub fn new(inner: Arc<dyn {}>, pool: Arc<BufferPool>) -> Self {{\n",
|
||||||
@@ -894,7 +894,6 @@ fn write_service(svc_proto: &ServiceDescriptorProto, package: &str, output: &mut
|
|||||||
output.push_str(" }\n");
|
output.push_str(" }\n");
|
||||||
output.push_str("}\n\n");
|
output.push_str("}\n\n");
|
||||||
|
|
||||||
|
|
||||||
output.push_str(&format!(
|
output.push_str(&format!(
|
||||||
"impl tonic::server::NamedService for {} {{\n",
|
"impl tonic::server::NamedService for {} {{\n",
|
||||||
server_name
|
server_name
|
||||||
@@ -910,7 +909,6 @@ fn write_service(svc_proto: &ServiceDescriptorProto, package: &str, output: &mut
|
|||||||
));
|
));
|
||||||
output.push_str("}\n\n");
|
output.push_str("}\n\n");
|
||||||
|
|
||||||
|
|
||||||
output.push_str(&format!(
|
output.push_str(&format!(
|
||||||
"impl Service<http::Request<BoxBody>> for {} {{\n",
|
"impl Service<http::Request<BoxBody>> for {} {{\n",
|
||||||
server_name
|
server_name
|
||||||
@@ -946,7 +944,8 @@ fn write_service(svc_proto: &ServiceDescriptorProto, package: &str, output: &mut
|
|||||||
output.push_str(" return Ok(http::Response::builder().status(200).body(res_body).unwrap());\n");
|
output.push_str(" return Ok(http::Response::builder().status(200).body(res_body).unwrap());\n");
|
||||||
output.push_str(" }\n\n");
|
output.push_str(" }\n\n");
|
||||||
output.push_str(" let payload = bytes_vec.slice(5..);\n");
|
output.push_str(" let payload = bytes_vec.slice(5..);\n");
|
||||||
output.push_str(" let mut routed = false;\n\n");
|
output.push_str(" #[allow(unused_assignments)]\n");
|
||||||
|
output.push_str(" let mut routed = false;\n");
|
||||||
|
|
||||||
let mut methods = Vec::new();
|
let mut methods = Vec::new();
|
||||||
for method_res in svc_proto.method() {
|
for method_res in svc_proto.method() {
|
||||||
@@ -1003,7 +1002,7 @@ fn write_service(svc_proto: &ServiceDescriptorProto, package: &str, output: &mut
|
|||||||
input_owned
|
input_owned
|
||||||
));
|
));
|
||||||
output.push_str(" Ok(msg) => msg,\n");
|
output.push_str(" Ok(msg) => msg,\n");
|
||||||
output.push_str(" Err(e) => {\n");
|
output.push_str(" Err(_e) => {\n");
|
||||||
output.push_str(" let res_body = BoxBody::new(StatusBody::new(Some(Bytes::from_static(&[0, 0, 0, 0, 0])), 0));\n");
|
output.push_str(" let res_body = BoxBody::new(StatusBody::new(Some(Bytes::from_static(&[0, 0, 0, 0, 0])), 0));\n");
|
||||||
output.push_str(" return Ok(http::Response::builder().status(200).body(res_body).unwrap());\n");
|
output.push_str(" return Ok(http::Response::builder().status(200).body(res_body).unwrap());\n");
|
||||||
output.push_str(" }\n");
|
output.push_str(" }\n");
|
||||||
@@ -1013,7 +1012,7 @@ fn write_service(svc_proto: &ServiceDescriptorProto, package: &str, output: &mut
|
|||||||
method_name
|
method_name
|
||||||
));
|
));
|
||||||
output.push_str(" Ok(res) => res,\n");
|
output.push_str(" Ok(res) => res,\n");
|
||||||
output.push_str(" Err(e) => {\n");
|
output.push_str(" Err(_e) => {\n");
|
||||||
output.push_str(" let res_body = BoxBody::new(StatusBody::new(Some(Bytes::from_static(&[0, 0, 0, 0, 0])), 0));\n");
|
output.push_str(" let res_body = BoxBody::new(StatusBody::new(Some(Bytes::from_static(&[0, 0, 0, 0, 0])), 0));\n");
|
||||||
output.push_str(" return Ok(http::Response::builder().status(200).body(res_body).unwrap());\n");
|
output.push_str(" return Ok(http::Response::builder().status(200).body(res_body).unwrap());\n");
|
||||||
output.push_str(" }\n");
|
output.push_str(" }\n");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @generated by protoc-gen-roto — do not edit
|
// @generated by protoc-gen-roto — do not edit
|
||||||
#[allow(unused_imports)]
|
#[allow(unused)]
|
||||||
|
|
||||||
use crate::runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator};
|
use crate::runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator};
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @generated by protoc-gen-roto — do not edit
|
// @generated by protoc-gen-roto — do not edit
|
||||||
#[allow(unused_imports)]
|
#[allow(unused)]
|
||||||
|
|
||||||
use crate::runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator};
|
use crate::runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator};
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_protoc_binary_compatibility() {
|
fn test_protoc_binary_compatibility() {
|
||||||
let data = include_bytes!("../data/test_data.pb");
|
let data = include_bytes!("../../data/test_data.pb");
|
||||||
let acc = ProtoAccessor::new(data).unwrap();
|
let acc = ProtoAccessor::new(data).unwrap();
|
||||||
|
|
||||||
// 1. Varints (Integers, Booleans, Enums)
|
// 1. Varints (Integers, Booleans, Enums)
|
||||||
|
|||||||
@@ -34,7 +34,11 @@ fn test_helloworld_generated_code_builds() {
|
|||||||
|
|
||||||
// Create new library project
|
// Create new library project
|
||||||
let status = Command::new("cargo")
|
let status = Command::new("cargo")
|
||||||
.args(["new", "--lib", temp_project_dir.to_str().expect("Invalid path")])
|
.args([
|
||||||
|
"new",
|
||||||
|
"--lib",
|
||||||
|
temp_project_dir.to_str().expect("Invalid path"),
|
||||||
|
])
|
||||||
.status()
|
.status()
|
||||||
.expect("Failed to run cargo new");
|
.expect("Failed to run cargo new");
|
||||||
assert!(status.success(), "cargo new failed");
|
assert!(status.success(), "cargo new failed");
|
||||||
@@ -44,7 +48,7 @@ fn test_helloworld_generated_code_builds() {
|
|||||||
let cargo_toml_content =
|
let cargo_toml_content =
|
||||||
fs::read_to_string(&cargo_toml_path).expect("Failed to read Cargo.toml");
|
fs::read_to_string(&cargo_toml_path).expect("Failed to read Cargo.toml");
|
||||||
let updated_cargo_toml = format!(
|
let updated_cargo_toml = format!(
|
||||||
"{}\n\nroto-codegen = {{ path = \"{}\" }}\nroto-runtime = {{ path = \"{}\" }}\nroto-tonic = {{ path = \"{}\" }}\nbytes = \"1.7\"\ntonic = \"0.12\"\ntokio-stream = \"0.1\"\ntower = \"0.4\"\nfutures-util = \"0.3\"\nhttp-body-util = \"0.1\"\nhttp-body = \"1.0\"\n\nhttp = \"1.0\"\n\n[workspace]\n",
|
"{}\n\nroto-codegen = {{ path = \"{}\" }}\nroto-runtime = {{ path = \"{}\" }}\nroto-tonic = {{ path = \"{}\" }}\nbytes = \"1.7\"\ntonic = \"0.12\"\ntokio-stream = \"0.1\"\ntower = \"0.4\"\nfutures-util = \"0.3\"\nhttp-body-util = \"0.1\"\nhttp-body = \"1.0\"\nasync-trait = \"0.1\"\n\nhttp = \"1.0\"\n\n[workspace]\n",
|
||||||
cargo_toml_content,
|
cargo_toml_content,
|
||||||
codegen_root.to_string_lossy(),
|
codegen_root.to_string_lossy(),
|
||||||
project_root.join("runtime").to_string_lossy(),
|
project_root.join("runtime").to_string_lossy(),
|
||||||
@@ -55,7 +59,10 @@ fn test_helloworld_generated_code_builds() {
|
|||||||
// 4. Write the generated code to src/lib.rs
|
// 4. Write the generated code to src/lib.rs
|
||||||
let mut all_code = String::new();
|
let mut all_code = String::new();
|
||||||
for (_, content) in generated_files {
|
for (_, content) in generated_files {
|
||||||
let replaced = content.replace("use crate::{BufferPool, StatusBody};", "use roto_tonic::{BufferPool, StatusBody};");
|
let replaced = content.replace(
|
||||||
|
"use crate::{BufferPool, StatusBody};",
|
||||||
|
"use roto_tonic::{BufferPool, StatusBody};",
|
||||||
|
);
|
||||||
all_code.push_str(&replaced);
|
all_code.push_str(&replaced);
|
||||||
all_code.push_str("\n");
|
all_code.push_str("\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
use roto_codegen::generator::generate_rust_code;
|
|
||||||
use roto_codegen::google::protobuf::descriptor::{
|
|
||||||
DescriptorProto, FieldDescriptorProto, FileDescriptorSet,
|
|
||||||
};
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_oneof_generation() {
|
fn test_oneof_generation() {
|
||||||
let mut set = FileDescriptorSet::new(b"").unwrap(); // Simplified for testing
|
|
||||||
|
|
||||||
// In a real scenario, we'd build up a FileDescriptorSet from a proto.
|
// In a real scenario, we'd build up a FileDescriptorSet from a proto.
|
||||||
// For this unit test, we'll manually construct a DescriptorProto that has a oneof.
|
// For this unit test, we'll manually construct a DescriptorProto that has a oneof.
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let proto_file = "proto/hello.proto";
|
let proto_file = "proto/hello.proto";
|
||||||
let out_dir = std::env::var("OUT_DIR").unwrap();
|
let out_dir = std::env::var("OUT_DIR").unwrap();
|
||||||
let dest_path = std::path::Path::new(&out_dir).join("hello.rs");
|
|
||||||
|
|
||||||
// Find the protoc-gen-roto binary
|
// Find the protoc-gen-roto binary
|
||||||
// Since we added roto-codegen to build-dependencies, it will be built.
|
// Since we added roto-codegen to build-dependencies, it will be built.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// @generated by protoc-gen-roto — do not edit
|
// @generated by protoc-gen-roto — do not edit
|
||||||
#[allow(unused_imports)]
|
#[allow(unused)]
|
||||||
|
|
||||||
use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator, RotoMessage};
|
use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator, RotoMessage};
|
||||||
use std::str;
|
use std::str;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// @generated by protoc-gen-roto — do not edit
|
// @generated by protoc-gen-roto — do not edit
|
||||||
#[allow(unused_imports)]
|
#![allow(unused)]
|
||||||
use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator, RotoMessage};
|
use roto_runtime::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator, RotoMessage};
|
||||||
use core::str;
|
use core::str;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use bytes::{Bytes, BytesMut, Buf, BufMut};
|
use bytes::{Bytes, BytesMut, Buf, BufMut};
|
||||||
|
|
||||||
pub struct UnaryRequest<'a> {
|
pub struct UnaryRequest<'a> {
|
||||||
@@ -81,12 +80,10 @@ impl<'b> UnaryRequestBuilder<'b> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
pub struct OwnedUnaryRequest {
|
pub struct OwnedUnaryRequest {
|
||||||
pub data: bytes::Bytes,
|
pub data: bytes::Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoOwned for OwnedUnaryRequest {
|
impl roto_runtime::RotoOwned for OwnedUnaryRequest {
|
||||||
type Reader<'a> = UnaryRequest<'a>;
|
type Reader<'a> = UnaryRequest<'a>;
|
||||||
fn reader(&self) -> UnaryRequest<'_> {
|
fn reader(&self) -> UnaryRequest<'_> {
|
||||||
@@ -94,7 +91,6 @@ impl roto_runtime::RotoOwned for OwnedUnaryRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoMessage for OwnedUnaryRequest {
|
impl roto_runtime::RotoMessage for OwnedUnaryRequest {
|
||||||
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
||||||
Ok(OwnedUnaryRequest { data: buf })
|
Ok(OwnedUnaryRequest { data: buf })
|
||||||
@@ -181,12 +177,10 @@ impl<'b> UnaryResponseBuilder<'b> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
pub struct OwnedUnaryResponse {
|
pub struct OwnedUnaryResponse {
|
||||||
pub data: bytes::Bytes,
|
pub data: bytes::Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoOwned for OwnedUnaryResponse {
|
impl roto_runtime::RotoOwned for OwnedUnaryResponse {
|
||||||
type Reader<'a> = UnaryResponse<'a>;
|
type Reader<'a> = UnaryResponse<'a>;
|
||||||
fn reader(&self) -> UnaryResponse<'_> {
|
fn reader(&self) -> UnaryResponse<'_> {
|
||||||
@@ -194,7 +188,6 @@ impl roto_runtime::RotoOwned for OwnedUnaryResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoMessage for OwnedUnaryResponse {
|
impl roto_runtime::RotoMessage for OwnedUnaryResponse {
|
||||||
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
||||||
Ok(OwnedUnaryResponse { data: buf })
|
Ok(OwnedUnaryResponse { data: buf })
|
||||||
@@ -281,12 +274,10 @@ impl<'b> StreamingRequestBuilder<'b> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
pub struct OwnedStreamingRequest {
|
pub struct OwnedStreamingRequest {
|
||||||
pub data: bytes::Bytes,
|
pub data: bytes::Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoOwned for OwnedStreamingRequest {
|
impl roto_runtime::RotoOwned for OwnedStreamingRequest {
|
||||||
type Reader<'a> = StreamingRequest<'a>;
|
type Reader<'a> = StreamingRequest<'a>;
|
||||||
fn reader(&self) -> StreamingRequest<'_> {
|
fn reader(&self) -> StreamingRequest<'_> {
|
||||||
@@ -294,7 +285,6 @@ impl roto_runtime::RotoOwned for OwnedStreamingRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoMessage for OwnedStreamingRequest {
|
impl roto_runtime::RotoMessage for OwnedStreamingRequest {
|
||||||
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
||||||
Ok(OwnedStreamingRequest { data: buf })
|
Ok(OwnedStreamingRequest { data: buf })
|
||||||
@@ -381,12 +371,10 @@ impl<'b> StreamingResponseBuilder<'b> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
pub struct OwnedStreamingResponse {
|
pub struct OwnedStreamingResponse {
|
||||||
pub data: bytes::Bytes,
|
pub data: bytes::Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoOwned for OwnedStreamingResponse {
|
impl roto_runtime::RotoOwned for OwnedStreamingResponse {
|
||||||
type Reader<'a> = StreamingResponse<'a>;
|
type Reader<'a> = StreamingResponse<'a>;
|
||||||
fn reader(&self) -> StreamingResponse<'_> {
|
fn reader(&self) -> StreamingResponse<'_> {
|
||||||
@@ -394,7 +382,6 @@ impl roto_runtime::RotoOwned for OwnedStreamingResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl roto_runtime::RotoMessage for OwnedStreamingResponse {
|
impl roto_runtime::RotoMessage for OwnedStreamingResponse {
|
||||||
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
fn decode(buf: bytes::Bytes) -> roto_runtime::Result<Self> {
|
||||||
Ok(OwnedStreamingResponse { data: buf })
|
Ok(OwnedStreamingResponse { data: buf })
|
||||||
@@ -407,58 +394,41 @@ impl roto_runtime::RotoMessage for OwnedStreamingResponse {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use tonic::{Request, Response, Status};
|
use tonic::{Request, Response, Status};
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use tokio_stream::Stream;
|
use tokio_stream::Stream;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use tonic::body::BoxBody;
|
use tonic::body::BoxBody;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use tower::Service;
|
use tower::Service;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use http_body_util::BodyExt;
|
use http_body_util::BodyExt;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use http_body::Body;
|
use http_body::Body;
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
use crate::{BufferPool, StatusBody};
|
use crate::{BufferPool, StatusBody};
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait InteropService: Send + Sync + 'static {
|
pub trait InteropService: Send + Sync + 'static {
|
||||||
async fn unary_call(&self, request: Request<OwnedUnaryRequest>) -> std::result::Result<Response<OwnedUnaryResponse>, Status>;
|
async fn unary_call(&self, request: Request<OwnedUnaryRequest>) -> std::result::Result<Response<OwnedUnaryResponse>, Status>;
|
||||||
async fn streaming_call(&self, request: Request<OwnedStreamingRequest>) -> std::result::Result<Response<Pin<Box<dyn Stream<Item = std::result::Result<OwnedStreamingResponse, Status>> + Send>>>, Status>;
|
async fn streaming_call(&self, request: Request<OwnedStreamingRequest>) -> std::result::Result<Response<Pin<Box<dyn Stream<Item = std::result::Result<OwnedStreamingResponse, Status>> + Send>>>, Status>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct InteropServiceServer {
|
pub struct InteropServiceServer {
|
||||||
inner: Arc<dyn InteropService>,
|
inner: Arc<dyn InteropService>,
|
||||||
pool: Arc<BufferPool>,
|
pool: Arc<BufferPool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl InteropServiceServer {
|
impl InteropServiceServer {
|
||||||
pub fn new(inner: Arc<dyn InteropService>, pool: Arc<BufferPool>) -> Self {
|
pub fn new(inner: Arc<dyn InteropService>, pool: Arc<BufferPool>) -> Self {
|
||||||
Self { inner, pool }
|
Self { inner, pool }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl tonic::server::NamedService for InteropServiceServer {
|
impl tonic::server::NamedService for InteropServiceServer {
|
||||||
const NAME: &'static str = "interop.InteropService";
|
const NAME: &'static str = "interop.InteropService";
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "alloc")]
|
|
||||||
impl Service<http::Request<BoxBody>> for InteropServiceServer {
|
impl Service<http::Request<BoxBody>> for InteropServiceServer {
|
||||||
type Response = http::Response<BoxBody>;
|
type Response = http::Response<BoxBody>;
|
||||||
type Error = std::convert::Infallible;
|
type Error = std::convert::Infallible;
|
||||||
|
|||||||
+12
-9
@@ -1,12 +1,11 @@
|
|||||||
use std::marker::PhantomData;
|
|
||||||
use tonic::codec::{Codec, Decoder, Encoder, DecodeBuf, EncodeBuf};
|
|
||||||
use bytes::{Buf, BufMut, Bytes, BytesMut};
|
use bytes::{Buf, BufMut, Bytes, BytesMut};
|
||||||
use roto_runtime::RotoMessage;
|
|
||||||
use std::sync::{Arc, Mutex};
|
|
||||||
use std::pin::Pin;
|
|
||||||
use std::future::Future;
|
|
||||||
use std::task::{Context, Poll};
|
|
||||||
use http_body::Body;
|
use http_body::Body;
|
||||||
|
use roto_runtime::RotoMessage;
|
||||||
|
use std::marker::PhantomData;
|
||||||
|
use std::pin::Pin;
|
||||||
|
use std::sync::Mutex;
|
||||||
|
use std::task::{Context, Poll};
|
||||||
|
use tonic::codec::{Codec, DecodeBuf, Decoder, EncodeBuf, Encoder};
|
||||||
|
|
||||||
pub mod generated {
|
pub mod generated {
|
||||||
pub mod helloworld;
|
pub mod helloworld;
|
||||||
@@ -95,7 +94,11 @@ impl BufferPool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get(&self) -> BytesMut {
|
pub fn get(&self) -> BytesMut {
|
||||||
self.pool.lock().unwrap().pop().unwrap_or_else(|| BytesMut::with_capacity(self.default_capacity))
|
self.pool
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.pop()
|
||||||
|
.unwrap_or_else(|| BytesMut::with_capacity(self.default_capacity))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn put(&self, mut buf: BytesMut) {
|
pub fn put(&self, mut buf: BytesMut) {
|
||||||
@@ -128,7 +131,7 @@ impl Body for StatusBody {
|
|||||||
|
|
||||||
fn poll_frame(
|
fn poll_frame(
|
||||||
mut self: Pin<&mut Self>,
|
mut self: Pin<&mut Self>,
|
||||||
cx: &mut Context<'_>,
|
_cx: &mut Context<'_>,
|
||||||
) -> Poll<Option<Result<http_body::Frame<Self::Data>, Self::Error>>> {
|
) -> Poll<Option<Result<http_body::Frame<Self::Data>, Self::Error>>> {
|
||||||
if let Some(data) = self.data.take() {
|
if let Some(data) = self.data.take() {
|
||||||
Poll::Ready(Some(Ok(http_body::Frame::data(data))))
|
Poll::Ready(Some(Ok(http_body::Frame::data(data))))
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use roto_runtime::RotoOwned;
|
|||||||
use roto_tonic::{BufferPool, generated::interop::{InteropService, InteropServiceServer, OwnedUnaryRequest, OwnedUnaryResponse, OwnedStreamingRequest, OwnedStreamingResponse, UnaryResponseBuilder}};
|
use roto_tonic::{BufferPool, generated::interop::{InteropService, InteropServiceServer, OwnedUnaryRequest, OwnedUnaryResponse, OwnedStreamingRequest, OwnedStreamingResponse, UnaryResponseBuilder}};
|
||||||
use futures_util::Stream;
|
use futures_util::Stream;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use bytes::BufMut;
|
|
||||||
|
|
||||||
struct InteropHandler;
|
struct InteropHandler;
|
||||||
|
|
||||||
|
|||||||
-229
@@ -1,229 +0,0 @@
|
|||||||
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2024 which implies `resolver = "3"`
|
|
||||||
|
|
|
||||||
= note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
|
|
||||||
= note: to use the edition 2024 resolver, specify `workspace.resolver = "3"` in the workspace root's manifest
|
|
||||||
= note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:5:7
|
|
||||||
|
|
|
||||||
5 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:184:7
|
|
||||||
|
|
|
||||||
184 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:189:7
|
|
||||||
|
|
|
||||||
189 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:197:7
|
|
||||||
|
|
|
||||||
197 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:384:7
|
|
||||||
|
|
|
||||||
384 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:389:7
|
|
||||||
|
|
|
||||||
389 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:397:7
|
|
||||||
|
|
|
||||||
397 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:684:7
|
|
||||||
|
|
|
||||||
684 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:689:7
|
|
||||||
|
|
|
||||||
689 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:697:7
|
|
||||||
|
|
|
||||||
697 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:909:7
|
|
||||||
|
|
|
||||||
909 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:914:7
|
|
||||||
|
|
|
||||||
914 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:922:7
|
|
||||||
|
|
|
||||||
922 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:1209:7
|
|
||||||
|
|
|
||||||
1209 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:1214:7
|
|
||||||
|
|
|
||||||
1214 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:1222:7
|
|
||||||
|
|
|
||||||
1222 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:1359:7
|
|
||||||
|
|
|
||||||
1359 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:1364:7
|
|
||||||
|
|
|
||||||
1364 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
warning: unexpected `cfg` condition value: `alloc`
|
|
||||||
--> benches/src/hackers.rs:1372:7
|
|
||||||
|
|
|
||||||
1372 | #[cfg(feature = "alloc")]
|
|
||||||
| ^^^^^^^^^^^^^^^^^ help: remove the condition
|
|
||||||
|
|
|
||||||
= note: no expected values for `feature`
|
|
||||||
= help: consider adding `alloc` as a feature in `Cargo.toml`
|
|
||||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
|
|
||||||
|
|
||||||
Compiling no_std_test v0.1.0 (/opt/workspace/examples/no_std_test)
|
|
||||||
warning: `roto-benches` (lib) generated 19 warnings
|
|
||||||
Compiling roto-tonic v0.1.0 (/opt/workspace/roto-tonic)
|
|
||||||
warning: `roto-benches` (lib test) generated 19 warnings (19 duplicates)
|
|
||||||
Compiling tonic v0.12.3
|
|
||||||
error: failed to run custom build command for `roto-tonic v0.1.0 (/opt/workspace/roto-tonic)`
|
|
||||||
|
|
||||||
Caused by:
|
|
||||||
process didn't exit successfully: `/opt/workspace/target/debug/build/roto-tonic-3195fff626ab2304/build-script-build` (exit status: 101)
|
|
||||||
--- stdout
|
|
||||||
cargo:rerun-if-changed=proto/interop.proto
|
|
||||||
cargo:rerun-if-changed=proto
|
|
||||||
|
|
||||||
--- stderr
|
|
||||||
|
|
||||||
thread 'main' (391) panicked at roto-tonic/build.rs:9:45:
|
|
||||||
Failed to compile protos with tonic-build: Custom { kind: NotFound, error: "Could not find `protoc`. If `protoc` is installed, try setting the `PROTOC` environment variable to the path of the `protoc` binary. To install it on Debian, run `apt-get install protobuf-compiler`. It is also available at https://github.com/protocolbuffers/protobuf/releases For more information: https://docs.rs/prost-build/#sourcing-protoc" }
|
|
||||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
|
||||||
warning: build failed, waiting for other jobs to finish...
|
|
||||||
error[E0152]: found duplicate lang item `panic_impl`
|
|
||||||
--> examples/no_std_test/src/main.rs:7:1
|
|
||||||
|
|
|
||||||
7 | / fn panic(_info: &PanicInfo) -> ! {
|
|
||||||
8 | | loop {}
|
|
||||||
9 | | }
|
|
||||||
| |_^
|
|
||||||
|
|
|
||||||
= note: the lang item is first defined in crate `std` (which `test` depends on)
|
|
||||||
= note: first definition in `std` loaded from /root/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-30b8a9ba02153abd.so, /root/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-30b8a9ba02153abd.rlib, /root/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libstd-30b8a9ba02153abd.rmeta
|
|
||||||
= note: second definition in the local crate (`no_std_test`)
|
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0152`.
|
|
||||||
error: could not compile `no_std_test` (bin "no_std_test" test) due to 1 previous error
|
|
||||||
Reference in New Issue
Block a user