Skip to content

Commit

Permalink
Update windows-sys, async-std and hermet versions. (#76)
Browse files Browse the repository at this point in the history
* Update windows-sys, async-std and hermet versions.

* Update wasi target name.
  • Loading branch information
sunfishcode authored Dec 4, 2024
1 parent 72f2ce9 commit 301d430
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,5 @@ jobs:
toolchain: ${{ matrix.rust }}
- run: >
rustup target add
wasm32-wasi
- run: cargo check --workspace --release -vv --target=wasm32-wasi
wasm32-wasip1
- run: cargo check --workspace --release -vv --target=wasm32-wasip1
13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rust-version = "1.63"
os_pipe = { version = "1.0.0", features = ["io_safety"], optional = true }

# Optionally depend on async-std just to provide impls for its types.
async-std = { version = "1.12.0", optional = true }
async-std = { version = "1.13.0", optional = true, features = ["io_safety"] }
# Optionally depend on tokio to implement traits for its types.
tokio = { version = "1.6.0", features = ["io-std", "fs", "net", "process"], optional = true }
# Optionally depend on socket2 to implement traits for its types.
Expand All @@ -30,13 +30,13 @@ socket2 = { version = "0.5.0", optional = true }
mio = { version = "0.8.0", features = ["net", "os-ext"], optional = true }

[target.'cfg(target_os = "hermit")'.dependencies]
hermit-abi = { version = "0.3", optional = true }
hermit-abi = { version = ">=0.3, <=0.4", optional = true }

[target.'cfg(not(windows))'.dependencies]
libc = { version = "0.2.96", optional = true }

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52.0"
version = ">=0.52, <=0.59"
optional = true
features = [
"Win32_Foundation",
Expand All @@ -48,8 +48,13 @@ features = [

[package.metadata.docs.rs]
features = ["close"]
rustdoc-args = ["--cfg", "doc_cfg"]

[features]
default = []
close = ["libc", "hermit-abi", "windows-sys"]

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
'cfg(wasi_ext)',
]
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#![cfg_attr(all(wasi_ext, target_os = "wasi"), feature(wasi_ext))]
// Currently supported platforms.
#![cfg(any(unix, windows, target_os = "wasi", target_os = "hermit"))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))]

mod portability;
mod traits;
Expand Down Expand Up @@ -133,7 +133,7 @@ pub use portability::{
};

#[cfg(feature = "close")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "close")))]
#[cfg_attr(docsrs, doc(cfg(feature = "close")))]
pub mod example_ffi;
pub mod raw;
pub mod views;
12 changes: 6 additions & 6 deletions src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,22 +236,22 @@ unsafe impl FilelikeViewType for os_pipe::PipeReader {}
unsafe impl SocketlikeViewType for socket2::Socket {}

#[cfg(not(any(target_os = "wasi", target_os = "hermit")))]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::net::TcpStream {}
#[cfg(not(any(target_os = "wasi", target_os = "hermit")))]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::net::TcpListener {}
#[cfg(not(any(target_os = "wasi", target_os = "hermit")))]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::net::UdpSocket {}
#[cfg(unix)]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixStream {}
#[cfg(unix)]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixListener {}
#[cfg(unix)]
#[cfg(feature = "async_std")]
#[cfg(feature = "async-std")]
unsafe impl SocketlikeViewType for async_std::os::unix::net::UnixDatagram {}

#[cfg(feature = "mio")]
Expand Down

0 comments on commit 301d430

Please sign in to comment.