From ec5e06bc6321a2f61c160490695abfcc7f6012e8 Mon Sep 17 00:00:00 2001 From: Michael Uti Date: Wed, 3 Jul 2024 18:09:09 +0100 Subject: [PATCH] chore: fix cyclic dependency in ockam_transport_udp --- Cargo.lock | 13 +++++++++- Cargo.toml | 1 + examples/rust/rendezvous/Cargo.toml | 25 +++++++++++++++++++ .../rust/rendezvous/src/bin}/client.rs | 0 .../rust/rendezvous/src/bin}/echo_server.rs | 0 .../rendezvous/src/bin}/rendezvous_server.rs | 0 .../rust/ockam/ockam_transport_udp/Cargo.toml | 10 -------- .../ockam/ockam_transport_udp/tests/utils.rs | 3 +-- 8 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 examples/rust/rendezvous/Cargo.toml rename {implementations/rust/ockam/ockam_transport_udp/examples => examples/rust/rendezvous/src/bin}/client.rs (100%) rename {implementations/rust/ockam/ockam_transport_udp/examples => examples/rust/rendezvous/src/bin}/echo_server.rs (100%) rename {implementations/rust/ockam/ockam_transport_udp/examples => examples/rust/rendezvous/src/bin}/rendezvous_server.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index b2d4d586bea..854db3b0466 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4926,7 +4926,6 @@ dependencies = [ "bytes 1.6.0", "futures-util", "minicbor", - "ockam", "ockam_core", "ockam_macros", "ockam_node", @@ -6030,6 +6029,18 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "rendezvous" +version = "0.1.0" +dependencies = [ + "ockam", + "ockam_core", + "ockam_macros", + "ockam_node", + "ockam_transport_udp", + "tracing", +] + [[package]] name = "reqwest" version = "0.12.5" diff --git a/Cargo.toml b/Cargo.toml index a91e363f0a3..5cd98233e91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] resolver = "2" members = [ + "examples/rust/rendezvous", "examples/rust/file_transfer", "examples/rust/get_started", "examples/rust/tcp_inlet_and_outlet", diff --git a/examples/rust/rendezvous/Cargo.toml b/examples/rust/rendezvous/Cargo.toml new file mode 100644 index 00000000000..70f483919e6 --- /dev/null +++ b/examples/rust/rendezvous/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "rendezvous" +version = "0.1.0" +authors = ["Ockam Developers"] +edition = "2021" +license = "Apache-2.0" +publish = false +rust-version = "1.56.0" + +[dependencies] +ockam = { path = "../../../implementations/rust/ockam/ockam" } +ockam_core = { path = "../../../implementations/rust/ockam/ockam_core" } +ockam_macros = { path = "../../../implementations/rust/ockam/ockam_macros" } +ockam_node = { path = "../../../implementations/rust/ockam/ockam_node" } +ockam_transport_udp = { path = "../../../implementations/rust/ockam/ockam_transport_udp" } +tracing = { version = "0.1", default-features = false } + +[[bin]] +name = "client" + +[[bin]] +name = "echo_server" + +[[bin]] +name = "rendezvous_server" diff --git a/implementations/rust/ockam/ockam_transport_udp/examples/client.rs b/examples/rust/rendezvous/src/bin/client.rs similarity index 100% rename from implementations/rust/ockam/ockam_transport_udp/examples/client.rs rename to examples/rust/rendezvous/src/bin/client.rs diff --git a/implementations/rust/ockam/ockam_transport_udp/examples/echo_server.rs b/examples/rust/rendezvous/src/bin/echo_server.rs similarity index 100% rename from implementations/rust/ockam/ockam_transport_udp/examples/echo_server.rs rename to examples/rust/rendezvous/src/bin/echo_server.rs diff --git a/implementations/rust/ockam/ockam_transport_udp/examples/rendezvous_server.rs b/examples/rust/rendezvous/src/bin/rendezvous_server.rs similarity index 100% rename from implementations/rust/ockam/ockam_transport_udp/examples/rendezvous_server.rs rename to examples/rust/rendezvous/src/bin/rendezvous_server.rs diff --git a/implementations/rust/ockam/ockam_transport_udp/Cargo.toml b/implementations/rust/ockam/ockam_transport_udp/Cargo.toml index e3a43dc9dc3..d55014639df 100644 --- a/implementations/rust/ockam/ockam_transport_udp/Cargo.toml +++ b/implementations/rust/ockam/ockam_transport_udp/Cargo.toml @@ -41,14 +41,4 @@ tokio-util = { version = "0.7.11", features = ["net", "codec"] } tracing = { version = "0.1", default-features = false } [dev-dependencies] -ockam = { path = "../ockam", version = "^0.129.0" } ockam_macros = { path = "../ockam_macros", version = "^0.34.0" } - -[[example]] -name = "client" - -[[example]] -name = "echo_server" - -[[example]] -name = "rendezvous_server" diff --git a/implementations/rust/ockam/ockam_transport_udp/tests/utils.rs b/implementations/rust/ockam/ockam_transport_udp/tests/utils.rs index 00b41cd9a07..be7adb202cb 100644 --- a/implementations/rust/ockam/ockam_transport_udp/tests/utils.rs +++ b/implementations/rust/ockam/ockam_transport_udp/tests/utils.rs @@ -1,5 +1,4 @@ -use ockam::{errcode::Origin, Error}; -use ockam_core::Result; +use ockam_core::{errcode::Origin, Error, Result}; use std::net::SocketAddr; use tokio::net::UdpSocket;