From 4c7c3508e175b1440277d5de4a4dc88a14497e9a Mon Sep 17 00:00:00 2001 From: Elijah Hampton Date: Tue, 25 Feb 2025 18:37:34 -0500 Subject: [PATCH 1/5] Arch gates -websys export targets in lib.rs. Arch gates dependencies for -websys targets. --- libp2p/Cargo.toml | 9 +++++---- libp2p/src/lib.rs | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index 4cfd2957a2a..ddb035477ed 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -91,6 +91,11 @@ webtransport-websys = ["dep:libp2p-webtransport-websys"] yamux = ["dep:libp2p-yamux"] upnp = ["dep:libp2p-upnp"] +[target.'cfg(target_arch = "wasm32")'.dependencies] +libp2p-webrtc-websys = { workspace = true, optional = true } +libp2p-websocket-websys = { workspace = true, optional = true } +libp2p-webtransport-websys = { workspace = true, optional = true } + [dependencies] bytes = "1" either = "1.9.0" @@ -99,7 +104,6 @@ futures-timer = "3.0.2" # Explicit dependency to be used in `wasm-bindgen` featu getrandom = { workspace = true } # Explicit dependency to be used in `wasm-bindgen` feature # TODO feature flag? rw-stream-sink = { workspace = true } - libp2p-allow-block-list = { workspace = true } libp2p-autonat = { workspace = true, optional = true } libp2p-connection-limits = { workspace = true } @@ -119,9 +123,6 @@ libp2p-relay = { workspace = true, optional = true } libp2p-rendezvous = { workspace = true, optional = true } libp2p-request-response = { workspace = true, optional = true } libp2p-swarm = { workspace = true } -libp2p-webrtc-websys = { workspace = true, optional = true } -libp2p-websocket-websys = { workspace = true, optional = true } -libp2p-webtransport-websys = { workspace = true, optional = true } libp2p-yamux = { workspace = true, optional = true } multiaddr = { workspace = true } pin-project = "1.0.0" diff --git a/libp2p/src/lib.rs b/libp2p/src/lib.rs index 80b5880f6d5..51f4eedeb1a 100644 --- a/libp2p/src/lib.rs +++ b/libp2p/src/lib.rs @@ -123,17 +123,17 @@ pub use libp2p_uds as uds; #[cfg(not(target_arch = "wasm32"))] #[doc(inline)] pub use libp2p_upnp as upnp; -#[cfg(feature = "webrtc-websys")] +#[cfg(all(feature = "webrtc-websys", target_arch = "wasm32"))] #[doc(inline)] pub use libp2p_webrtc_websys as webrtc_websys; #[cfg(feature = "websocket")] #[cfg(not(target_arch = "wasm32"))] #[doc(inline)] pub use libp2p_websocket as websocket; -#[cfg(feature = "websocket-websys")] +#[cfg(all(feature = "websocket-websys", target_arch = "wasm32"))] #[doc(inline)] pub use libp2p_websocket_websys as websocket_websys; -#[cfg(feature = "webtransport-websys")] +#[cfg(all(feature = "webtransport-websys", target_arch = "wasm32"))] #[cfg_attr(docsrs, doc(cfg(feature = "webtransport-websys")))] #[doc(inline)] pub use libp2p_webtransport_websys as webtransport_websys; From 9329b017ad6a48bb0228f0ddb163a30475e61b8f Mon Sep 17 00:00:00 2001 From: Elijah Hampton Date: Tue, 25 Feb 2025 19:40:52 -0500 Subject: [PATCH 2/5] Changes ordering of dependencies --- libp2p/Cargo.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index ddb035477ed..870f0f2e131 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -91,11 +91,6 @@ webtransport-websys = ["dep:libp2p-webtransport-websys"] yamux = ["dep:libp2p-yamux"] upnp = ["dep:libp2p-upnp"] -[target.'cfg(target_arch = "wasm32")'.dependencies] -libp2p-webrtc-websys = { workspace = true, optional = true } -libp2p-websocket-websys = { workspace = true, optional = true } -libp2p-webtransport-websys = { workspace = true, optional = true } - [dependencies] bytes = "1" either = "1.9.0" @@ -128,6 +123,11 @@ multiaddr = { workspace = true } pin-project = "1.0.0" thiserror = { workspace = true } +[target.'cfg(target_arch = "wasm32")'.dependencies] +libp2p-webrtc-websys = { workspace = true, optional = true } +libp2p-websocket-websys = { workspace = true, optional = true } +libp2p-webtransport-websys = { workspace = true, optional = true } + [target.'cfg(not(target_arch = "wasm32"))'.dependencies] libp2p-dns = { workspace = true, optional = true } libp2p-mdns = { workspace = true, optional = true } From 9efa6433eba48c8d37073130fe04932447a28152 Mon Sep 17 00:00:00 2001 From: Elijah Hampton Date: Tue, 25 Feb 2025 20:44:50 -0500 Subject: [PATCH 3/5] Bumps patch version. Adds changes to CHANGELOG --- libp2p/CHANGELOG.md | 5 +++++ libp2p/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index dcf1ad7254d..d454b6299f4 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.55.2 + +- Make the `*-websys` variants (`libp2p-webrtc-websys`, `libp2p-websocket-websys`, `libp2p-webtransport-websys`) only available on wasm32 target architecture. + See [PR 5891](https://github.com/libp2p/rust-libp2p/pull/5891). + ## 0.55.1 - Introduce `libp2p-webrtc-websys` behind `webrtc-websys` feature flag. See [PR 5819](https://github.com/libp2p/rust-libp2p/pull/5819). diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index 870f0f2e131..e47b809a191 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p" edition = "2021" rust-version = { workspace = true } description = "Peer-to-peer networking library" -version = "0.55.1" +version = "0.55.2" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" From 716162d8986a4dca3da8e4f3a4ba561b55afdbe5 Mon Sep 17 00:00:00 2001 From: Elijah Hampton Date: Tue, 25 Feb 2025 21:44:07 -0500 Subject: [PATCH 4/5] Update Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 02d1318ea35..7406e989743 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2666,7 +2666,7 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libp2p" -version = "0.55.1" +version = "0.55.2" dependencies = [ "async-std", "bytes", From d1fb670905187284d507b94752ed6184eb089610 Mon Sep 17 00:00:00 2001 From: Elijah Hampton Date: Wed, 26 Feb 2025 17:13:43 -0500 Subject: [PATCH 5/5] Revert patch version update and moves changelog entry to correct version --- Cargo.lock | 2 +- libp2p/CHANGELOG.md | 8 +++----- libp2p/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7406e989743..02d1318ea35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2666,7 +2666,7 @@ checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libp2p" -version = "0.55.2" +version = "0.55.1" dependencies = [ "async-std", "bytes", diff --git a/libp2p/CHANGELOG.md b/libp2p/CHANGELOG.md index d454b6299f4..d75bd7fd9fa 100644 --- a/libp2p/CHANGELOG.md +++ b/libp2p/CHANGELOG.md @@ -1,12 +1,10 @@ -## 0.55.2 - -- Make the `*-websys` variants (`libp2p-webrtc-websys`, `libp2p-websocket-websys`, `libp2p-webtransport-websys`) only available on wasm32 target architecture. - See [PR 5891](https://github.com/libp2p/rust-libp2p/pull/5891). - ## 0.55.1 - Introduce `libp2p-webrtc-websys` behind `webrtc-websys` feature flag. See [PR 5819](https://github.com/libp2p/rust-libp2p/pull/5819). +- Make the `*-websys` variants (`libp2p-webrtc-websys`, `libp2p-websocket-websys`, `libp2p-webtransport-websys`) only available on wasm32 target architecture. + See [PR 5891](https://github.com/libp2p/rust-libp2p/pull/5891). + ## 0.55.0 - Raise MSRV to 1.83.0. diff --git a/libp2p/Cargo.toml b/libp2p/Cargo.toml index e47b809a191..870f0f2e131 100644 --- a/libp2p/Cargo.toml +++ b/libp2p/Cargo.toml @@ -3,7 +3,7 @@ name = "libp2p" edition = "2021" rust-version = { workspace = true } description = "Peer-to-peer networking library" -version = "0.55.2" +version = "0.55.1" authors = ["Parity Technologies "] license = "MIT" repository = "https://github.com/libp2p/rust-libp2p"