diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 13853eb..ce524e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,115 @@ jobs: toolchain: stable - run: cargo fmt --all -- --check + check: + name: Check + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [stable, nightly] + include: + - build: stable + os: ubuntu-latest + rust: stable + - build: nightly + os: ubuntu-latest + rust: nightly + + env: + # -D warnings is commented out in our install-rust action; re-add it here. + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: ./.github/actions/install-rust + with: + toolchain: ${{ matrix.rust }} + + - run: rustup target add x86_64-apple-darwin + - run: cargo check --workspace --release -vv + - run: cargo check --workspace --release -vv --all-features + - run: cargo check --workspace --release -vv --target=x86_64-apple-darwin + - run: cargo check --workspace --release -vv --target=x86_64-apple-darwin --all-features + + check-1_48: + name: Check + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [1.48] + include: + - build: 1.48 + os: ubuntu-latest + rust: 1.48 + + env: + # -D warnings is commented out in our install-rust action; re-add it here. + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: ./.github/actions/install-rust + with: + toolchain: ${{ matrix.rust }} + + - run: rustup target add x86_64-apple-darwin + - run: cargo check --workspace --release -vv + - run: cargo check --workspace --release -vv --target=x86_64-apple-darwin + + check-windows: + name: Check Windows + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [stable, nightly] + include: + - build: stable + os: windows-latest + rust: stable + - build: nightly + os: windows-latest + rust: nightly + + env: + # -D warnings is commented out in our install-rust action; re-add it here. + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: ./.github/actions/install-rust + with: + toolchain: ${{ matrix.rust }} + + - run: cargo check --workspace --release -vv + - run: cargo check --workspace --release -vv --all-features + + check-windows-1_48: + name: Check Windows + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [1.48] + include: + - build: 1.48 + os: windows-latest + rust: 1.48 + + env: + # -D warnings is commented out in our install-rust action; re-add it here. + RUSTFLAGS: -D warnings + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: ./.github/actions/install-rust + with: + toolchain: ${{ matrix.rust }} + + - run: cargo check --workspace --release -vv + test: name: Test runs-on: ${{ matrix.os }} diff --git a/Cargo.toml b/Cargo.toml index ccc2511..32c15a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,14 +17,6 @@ include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"] # we'll prefer to have crates provide their own impls; this is just a # temporary measure. -# Optionally depend on async-std just to provide impls for its types for now. -async-std = { version = "1.12.0", default-features = false, optional = true } -# Optionally depend on tokio to implement traits for its types for now. -tokio = { version = "1.6.0", features = ["io-std", "fs", "net", "process"], optional = true } -# Optionally depend on socket2 to implement traits for its types for now. -socket2 = { version = "0.4.0", optional = true } -# Optionally depend on mio to implement traits for its types for now. -mio = { version = "0.8.0", features = ["net", "os-ext"], optional = true } # Optionally depend on fs_err to implement traits for its types for now. fs-err = { version = "2.6.0", optional = true } @@ -32,6 +24,25 @@ fs-err = { version = "2.6.0", optional = true } # Optionally depend on os_pipe to implement traits for its types for now. os_pipe = { version = "1.0.0", optional = true } +# The following dependencies allow io-lifetimes to define impls for various +# third-party traits. This is only done in not(io_lifetimes_use_std) mode, +# because when we're using the std types and traits, we can't define impls +# on third-party traits, due to the orphan rule. Work is ongoing to add +# the needs impls upstream. +# +# These dependencies are currently disabled on WASI, because we need to +# enable some features which don't work on WASI yet. So for now, WASI users +# will need to wait until the impls are added upstream. + +# Optionally depend on async-std just to provide impls for its types. +async-std = { version = "1.12.0", optional = true } +# 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. +socket2 = { version = "0.4.0", optional = true } +# Optionally depend on mio to implement traits for its types. +mio = { version = "0.8.0", features = ["net", "os-ext"], optional = true } + [target.'cfg(not(windows))'.dependencies] libc = { version = "0.2.96", optional = true } diff --git a/README.md b/README.md index 0a97bed..b8c9227 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,13 @@ they're simpler and safer to use. io-lifetimes doesn't include unsafe-io's `*ReadWrite*` or `*HandleOrSocket*` abstractions, and leaves these as features to be provided by separate layers on top. +## Minimum Supported Rust Version (MSRV) + +This crate currently works on the version of [Rust on Debian stable], which is +currently Rust 1.48. This policy may change in the future, in minor version +releases, so users using a fixed version of Rust should pin to a specific +version of this crate. + [`OwnedFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/struct.OwnedFd.html [`BorrowedFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/struct.BorrowedFd.html [RFC 3128]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md diff --git a/src/impls_std.rs b/src/impls_std.rs index 27275fa..145bb19 100644 --- a/src/impls_std.rs +++ b/src/impls_std.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] // Don't warn on `IntoFd` and `FromFd` impls. + #[cfg(any(unix, target_os = "wasi"))] use crate::{AsFd, FromFd, IntoFd}; #[cfg(windows)] diff --git a/src/lib.rs b/src/lib.rs index 2b3f1fd..1ff99e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,6 @@ #![deny(missing_docs)] #![cfg_attr(rustc_attrs, feature(rustc_attrs))] -#![cfg_attr(all(io_lifetimes_use_std, target_os = "wasi"), feature(wasi_ext))] mod portability; mod traits;