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
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
sparcv9-sun-solaris
aarch64-linux-android
aarch64-apple-ios
wasm32-wasi
- if: matrix.rust != '1.48'
run: rustup target add x86_64-unknown-fuchsia
- if: matrix.rust == '1.48'
Expand Down Expand Up @@ -132,6 +133,10 @@ jobs:
- run: cargo check --workspace --release -vv --target=sparcv9-sun-solaris --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-apple-ios --features=all-apis --all-targets
- run: cargo check --workspace --release -vv --target=aarch64-linux-android --features=all-apis --all-targets
# Omit --all-targets for WASI until all the dev-dependencies support WASI
# on stable.
- if: matrix.rust != '1.48'
run: cargo check --workspace --release -vv --target=wasm32-wasi --features=all-apis

check_no_default_features:
name: Check --no-default-features
Expand Down
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ fn main() {
{
use_feature("bsd");
}
if target_os == "wasi" {
use_feature_or_nothing("wasi_ext");
}

println!("cargo:rerun-if-env-changed=CARGO_CFG_RUSTIX_USE_EXPERIMENTAL_ASM");
println!("cargo:rerun-if-env-changed=CARGO_CFG_RUSTIX_USE_LIBC");
Expand Down
5 changes: 1 addition & 4 deletions src/fs/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::backend;

pub use crate::io::FdFlags;
pub use backend::fs::types::{Access, Mode, OFlags};
pub use backend::fs::types::{Access, Dev, Mode, OFlags};

#[cfg(not(target_os = "redox"))]
pub use backend::fs::types::AtFlags;
Expand All @@ -14,7 +14,4 @@ pub use backend::fs::types::{CloneFlags, CopyfileFlags};
#[cfg(any(target_os = "android", target_os = "linux"))]
pub use backend::fs::types::*;

#[cfg(not(target_os = "redox"))]
pub use backend::fs::types::Dev;

pub use backend::time::types::{Nsecs, Secs, Timespec};
2 changes: 1 addition & 1 deletion src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,5 @@ pub use sync::sync;
#[cfg(unix)]
pub use std::os::unix::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt};
#[cfg(feature = "std")]
#[cfg(target_os = "wasi")]
#[cfg(all(wasi_ext, target_os = "wasi"))]
pub use std::os::wasi::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt};
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
#![cfg_attr(linux_raw, deny(unsafe_code))]
#![cfg_attr(rustc_attrs, feature(rustc_attrs))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(all(target_os = "wasi", feature = "std"), feature(wasi_ext))]
#![cfg_attr(all(wasi_ext, target_os = "wasi", feature = "std"), feature(wasi_ext))]
#![cfg_attr(
all(linux_raw, naked_functions, target_arch = "x86"),
feature(naked_functions)
Expand All @@ -122,6 +122,9 @@
#![allow(clippy::unnecessary_cast)]
// It is common in linux and libc APIs for types to vary between platforms.
#![allow(clippy::useless_conversion)]
// Redox and WASI have enough differences that it isn't worth
// precisely conditionallizing all the `use`s for them.
#![cfg_attr(any(target_os = "redox", target_os = "wasi"), allow(unused_imports))]

#[cfg(not(feature = "rustc-dep-of-std"))]
extern crate alloc;
Expand Down
2 changes: 1 addition & 1 deletion tests/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn test_backends() {

#[cfg(windows)]
let libc_dep = "windows-sys";
#[cfg(unix)]
#[cfg(any(unix, target_os = "wasi"))]
let libc_dep = "libc";

// Test the use-libc crate, which enables the "use-libc" cargo feature.
Expand Down