Skip to content

Commit

Permalink
refactor(uds): Move WASM feature flagging to root Cargo.toml
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mxinden authored Mar 7, 2023
1 parent 6b73dac commit 2c10cd8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ libp2p-relay = { version = "0.15.0", path = "protocols/relay", optional = true }
libp2p-rendezvous = { version = "0.12.0", path = "protocols/rendezvous", optional = true }
libp2p-request-response = { version = "0.24.0", path = "protocols/request-response", optional = true }
libp2p-swarm = { version = "0.42.0", path = "swarm" }
libp2p-uds = { version = "0.38.0", path = "transports/uds", optional = true }
libp2p-wasm-ext = { version = "0.39.0", path = "transports/wasm-ext", optional = true }
libp2p-yamux = { version = "0.43.0", path = "muxers/yamux", optional = true }
multiaddr = { version = "0.17.0" }
Expand All @@ -121,6 +120,7 @@ libp2p-mdns = { version = "0.43.0", path = "protocols/mdns", optional = true }
libp2p-quic = { version = "=0.7.0-alpha.2", path = "transports/quic", optional = true }
libp2p-tcp = { version = "0.39.0", path = "transports/tcp", optional = true }
libp2p-tls = { version = "=0.1.0-alpha.2", path = "transports/tls", optional = true }
libp2p-uds = { version = "0.38.0", path = "transports/uds", optional = true }
libp2p-webrtc = { version = "=0.4.0-alpha.2", path = "transports/webrtc", optional = true }
libp2p-websocket = { version = "0.41.0", path = "transports/websocket", optional = true }

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ pub use libp2p_tcp as tcp;
#[doc(inline)]
pub use libp2p_tls as tls;
#[cfg(feature = "uds")]
#[cfg_attr(docsrs, doc(cfg(feature = "uds")))]
#[cfg(not(any(target_os = "emscripten", target_os = "wasi", target_os = "unknown")))]
#[doc(inline)]
pub use libp2p_uds as uds;
#[cfg(feature = "wasm-ext")]
Expand Down
4 changes: 2 additions & 2 deletions transports/uds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

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

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

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

0 comments on commit 2c10cd8

Please sign in to comment.