diff --git a/.github/actions/install-rust/action.yml b/.github/actions/install-rust/action.yml index 6afc01d..11c0576 100644 --- a/.github/actions/install-rust/action.yml +++ b/.github/actions/install-rust/action.yml @@ -8,5 +8,5 @@ inputs: default: 'stable' runs: - using: node16 + using: node20 main: 'main.js' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0915e98..8c42a75 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/install-rust @@ -34,7 +34,7 @@ jobs: rust: beta steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/install-rust @@ -102,7 +102,7 @@ jobs: rust: nightly steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/install-rust @@ -163,7 +163,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - build: [stable, windows, macos, macos-11.0, beta, ubuntu-20.04, windows-2019, aarch64-ubuntu] + build: [stable, windows, macos, macos-13, beta, ubuntu-20.04, windows-2019, aarch64-ubuntu] include: - build: stable os: ubuntu-latest @@ -174,8 +174,8 @@ jobs: - build: macos os: macos-latest rust: stable - - build: macos-11.0 - os: macos-11.0 + - build: macos-13 + os: macos-13 rust: stable - build: beta os: ubuntu-latest @@ -196,7 +196,7 @@ jobs: qemu_target: aarch64-linux-user steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/install-rust @@ -254,7 +254,7 @@ jobs: rust: nightly steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/install-rust @@ -276,7 +276,7 @@ jobs: rust: stable steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - uses: ./.github/actions/install-rust diff --git a/Cargo.toml b/Cargo.toml index 41ebaed..5f71a06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,10 @@ edition = "2021" exclude = ["/.github"] [dependencies] -#async-std = { version = "1.10.0", optional = true } +async-std = { version = "1.13.0", optional = true, features = ["io_safety"] } bitflags = "2.2.3" cap-std = { version = "3.0.0", optional = true } -#cap-async-std = { version = "0.26.0", optional = true } +cap-async-std = { version = "3.0.0", optional = true } char-device = { version = "0.16.0", optional = true } os_pipe = { version = "1.0.0", features = ["io_safety"], optional = true } socketpair = { version = "0.19.0", optional = true } @@ -32,7 +32,7 @@ winx = "0.36.0" fd-lock = "4.0.0" [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.52.0" +version = ">=0.52, <=0.59" features = [ "Win32_Foundation", "Win32_Networking_WinSock", @@ -49,8 +49,16 @@ tempfile = "3.2.0" [features] default = [] cap_std_impls = ["cap-std"] -#cap_async_std_impls = ["async-std", "cap-async-std", "io-lifetimes/async-std"] +cap_async_std_impls = ["async-std", "cap-async-std", "io-lifetimes/async-std"] cap_std_impls_fs_utf8 = ["cap-std/fs_utf8"] -#cap_async_std_impls_fs_utf8 = ["async-std", "cap-async-std/fs_utf8"] +cap_async_std_impls_fs_utf8 = ["async-std", "cap-async-std/fs_utf8"] use_os_pipe = ["os_pipe", "io-lifetimes/os_pipe"] #use_socket2 = ["socket2", "io-lifetimes/socket2"] + +[lints.rust.unexpected_cfgs] +level = "warn" +check-cfg = [ + 'cfg(racy_asserts)', + 'cfg(unix_socket_peek)', + 'cfg(feature, values("socket2"))', +] diff --git a/build.rs b/build.rs index f953cea..dd07870 100644 --- a/build.rs +++ b/build.rs @@ -44,7 +44,6 @@ fn has_feature(feature: &str) -> bool { fn can_compile>(test: T) -> bool { use std::process::Stdio; - let out_dir = var("OUT_DIR").unwrap(); let rustc = var("RUSTC").unwrap(); let target = var("TARGET").unwrap(); @@ -68,8 +67,9 @@ fn can_compile>(test: T) -> bool { .arg("--emit=metadata") // Do as little as possible but still parse. .arg("--target") .arg(target) - .arg("--out-dir") - .arg(out_dir); // Put the output somewhere inconsequential. + .arg("-o") + .arg("-") + .stdout(Stdio::null()); // We don't care about the output (only whether it builds or not) // If Cargo wants to set RUSTFLAGS, use that. if let Ok(rustflags) = var("CARGO_ENCODED_RUSTFLAGS") { diff --git a/src/io/is_read_write.rs b/src/io/is_read_write.rs index d77c979..5cbc258 100644 --- a/src/io/is_read_write.rs +++ b/src/io/is_read_write.rs @@ -52,7 +52,7 @@ impl IsReadWrite for cap_std::fs_utf8::File { } } -#[cfg(all(windows, feature = "async_std"))] +#[cfg(all(windows, feature = "async-std"))] impl IsReadWrite for async_std::fs::File { #[inline] fn is_read_write(&self) -> io::Result<(bool, bool)> { @@ -61,7 +61,7 @@ impl IsReadWrite for async_std::fs::File { } } -#[cfg(all(windows, feature = "async_std"))] +#[cfg(all(windows, feature = "async-std"))] impl IsReadWrite for cap_async_std::fs::File { #[inline] fn is_read_write(&self) -> io::Result<(bool, bool)> { @@ -70,7 +70,11 @@ impl IsReadWrite for cap_async_std::fs::File { } } -#[cfg(all(windows, feature = "async_std", feature = "fs_utf8"))] +#[cfg(all( + windows, + feature = "async-std", + feature = "cap_async_std_impls_fs_utf8" +))] impl IsReadWrite for cap_async_std::fs_utf8::File { #[inline] fn is_read_write(&self) -> io::Result<(bool, bool)> { diff --git a/src/lib.rs b/src/lib.rs index b48dda5..f7b4acd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ #![deny(missing_docs)] #![cfg_attr(target_os = "wasi", feature(wasi_ext))] #![cfg_attr(all(unix, unix_socket_peek), feature(unix_socket_peek))] -#![cfg_attr(io_lifetimes_use_std, feature(io_safety))] pub mod fs; pub mod io;