Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ inputs:
default: 'stable'

runs:
using: node16
using: node20
main: 'main.js'
18 changes: 9 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,7 +34,7 @@ jobs:
rust: beta

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
rust: nightly

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
rust: nightly

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
Expand All @@ -276,7 +276,7 @@ jobs:
rust: stable

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/actions/install-rust
Expand Down
18 changes: 13 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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",
Expand All @@ -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"))',
]
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ fn has_feature(feature: &str) -> bool {
fn can_compile<T: AsRef<str>>(test: T) -> bool {
use std::process::Stdio;

let out_dir = var("OUT_DIR").unwrap();
let rustc = var("RUSTC").unwrap();
let target = var("TARGET").unwrap();

Expand All @@ -68,8 +67,9 @@ fn can_compile<T: AsRef<str>>(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") {
Expand Down
10 changes: 7 additions & 3 deletions src/io/is_read_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)> {
Expand All @@ -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)> {
Expand All @@ -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)> {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Loading