Skip to content

Commit 2c10cd8

Browse files
authored
refactor(uds): Move WASM feature flagging to root Cargo.toml
Crates that don't compile for WASM are feature flagged in the root `Cargo.toml`, expcept for `libp2p-uds`. This commit removes the inconsistency. As a side-effect, this might help prevent bugs like #3502 going forward. Pull-Request: #3503.
1 parent 6b73dac commit 2c10cd8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ libp2p-relay = { version = "0.15.0", path = "protocols/relay", optional = true }
108108
libp2p-rendezvous = { version = "0.12.0", path = "protocols/rendezvous", optional = true }
109109
libp2p-request-response = { version = "0.24.0", path = "protocols/request-response", optional = true }
110110
libp2p-swarm = { version = "0.42.0", path = "swarm" }
111-
libp2p-uds = { version = "0.38.0", path = "transports/uds", optional = true }
112111
libp2p-wasm-ext = { version = "0.39.0", path = "transports/wasm-ext", optional = true }
113112
libp2p-yamux = { version = "0.43.0", path = "muxers/yamux", optional = true }
114113
multiaddr = { version = "0.17.0" }
@@ -121,6 +120,7 @@ libp2p-mdns = { version = "0.43.0", path = "protocols/mdns", optional = true }
121120
libp2p-quic = { version = "=0.7.0-alpha.2", path = "transports/quic", optional = true }
122121
libp2p-tcp = { version = "0.39.0", path = "transports/tcp", optional = true }
123122
libp2p-tls = { version = "=0.1.0-alpha.2", path = "transports/tls", optional = true }
123+
libp2p-uds = { version = "0.38.0", path = "transports/uds", optional = true }
124124
libp2p-webrtc = { version = "=0.4.0-alpha.2", path = "transports/webrtc", optional = true }
125125
libp2p-websocket = { version = "0.41.0", path = "transports/websocket", optional = true }
126126

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ pub use libp2p_tcp as tcp;
119119
#[doc(inline)]
120120
pub use libp2p_tls as tls;
121121
#[cfg(feature = "uds")]
122+
#[cfg_attr(docsrs, doc(cfg(feature = "uds")))]
123+
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
122124
#[doc(inline)]
123125
pub use libp2p_uds as uds;
124126
#[cfg(feature = "wasm-ext")]

transports/uds/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ repository = "https://github.com/libp2p/rust-libp2p"
1010
keywords = ["peer-to-peer", "libp2p", "networking"]
1111
categories = ["network-programming", "asynchronous"]
1212

13-
[target.'cfg(all(unix, not(target_os = "emscripten")))'.dependencies]
13+
[dependencies]
1414
async-std = { version = "1.6.2", optional = true }
1515
libp2p-core = { version = "0.39.0", path = "../../core" }
1616
log = "0.4.1"
1717
futures = "0.3.26"
1818
tokio = { version = "1.15", default-features = false, features = ["net"], optional = true }
1919

20-
[target.'cfg(all(unix, not(target_os = "emscripten")))'.dev-dependencies]
20+
[dev-dependencies]
2121
tempfile = "3.4"
2222

2323
# Passing arguments to the docsrs builder in order to properly document cfg's.

0 commit comments

Comments
 (0)