diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe37dd414..7b235c753 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,6 +97,7 @@ jobs: cargo update --package=io-lifetimes --precise 1.0.6 cd - >/dev/null done + cargo update --package=tempfile --precise=3.6.0 - run: cargo check --workspace --release -vv --all-targets - run: cargo check --workspace --release -vv --features=all-apis --all-targets @@ -479,6 +480,7 @@ jobs: cargo update --package=io-lifetimes --precise 1.0.6 cd - >/dev/null done + cargo update --package=tempfile --precise=3.6.0 - run: | # Run the tests, and check the prebuilt release libraries. diff --git a/Cargo.toml b/Cargo.toml index 4d1b1dc14..3f27933c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,24 +73,12 @@ tempfile = "3.2.0" libc = "0.2.133" libc_errno = { package = "errno", version = "0.3.0", default-features = false } io-lifetimes = { version = "1.0.0", default-features = false, features = ["close"] } -# Don't upgrade to serial_test 0.7 for now because it depends on a -# `parking_lot_core` version which is not compatible with our MSRV of 1.48. -serial_test = "0.6" memoffset = "0.7.1" flate2 = "1.0" -[target.'cfg(all(criterion, not(any(target_os = "emscripten", target_os = "wasi"))))'.dev-dependencies] -criterion = "0.4" - [target.'cfg(windows)'.dev-dependencies] ctor = "0.1.21" -# Add Criterion configuration, as described here: -# -[[bench]] -name = "mod" -harness = false - [package.metadata.docs.rs] features = ["all-apis"] rustdoc-args = ["--cfg", "doc_cfg"] diff --git a/benches/mod.rs b/benches/mod.rs deleted file mode 100644 index 06831362f..000000000 --- a/benches/mod.rs +++ /dev/null @@ -1,182 +0,0 @@ -/// Benchmarks for rustix. -/// -/// To enable these benchmarks, add `--cfg=criterion` to RUSTFLAGS and enable -/// the "fs", "time", and "process" cargo features. - -#[cfg(any( - not(criterion), - not(feature = "fs"), - not(feature = "process"), - not(feature = "time"), - windows, - target_os = "emscripten", - target_os = "redox", - target_os = "wasi", -))] -fn main() { - unimplemented!() -} - -#[cfg(not(any( - not(criterion), - not(feature = "fs"), - not(feature = "process"), - not(feature = "time"), - windows, - target_os = "emscripten", - target_os = "redox", - target_os = "wasi", -)))] -use criterion::{criterion_group, criterion_main}; - -#[cfg(not(any( - not(criterion), - not(feature = "fs"), - not(feature = "process"), - not(feature = "time"), - windows, - target_os = "emscripten", - target_os = "redox", - target_os = "wasi", -)))] -mod suite { - use criterion::Criterion; - - pub(super) fn simple_statat(c: &mut Criterion) { - use rustix::fs::{cwd, statat, AtFlags}; - - c.bench_function("simple statat", |b| { - b.iter(|| { - statat(cwd(), "/", AtFlags::empty()).unwrap(); - }) - }); - } - - pub(super) fn simple_statat_libc(c: &mut Criterion) { - c.bench_function("simple statat libc", |b| { - b.iter(|| { - let mut s = std::mem::MaybeUninit::::uninit(); - unsafe { - assert_eq!( - libc::fstatat( - libc::AT_FDCWD, - std::ffi::CString::new("/").unwrap().as_c_str().as_ptr() as _, - s.as_mut_ptr(), - 0 - ), - 0 - ); - } - }) - }); - } - - pub(super) fn simple_statat_libc_cstr(c: &mut Criterion) { - c.bench_function("simple statat libc cstr", |b| { - b.iter(|| { - let mut s = std::mem::MaybeUninit::::uninit(); - unsafe { - assert_eq!( - libc::fstatat( - libc::AT_FDCWD, - rustix::cstr!("/").as_ptr() as _, - s.as_mut_ptr(), - 0 - ), - 0 - ); - } - }) - }); - } - - pub(super) fn simple_statat_cstr(c: &mut Criterion) { - use rustix::fs::{cwd, statat, AtFlags}; - - c.bench_function("simple statat cstr", |b| { - b.iter(|| { - statat(cwd(), rustix::cstr!("/"), AtFlags::empty()).unwrap(); - }) - }); - } - - #[cfg(not(target_os = "wasi"))] - pub(super) fn simple_clock_gettime(c: &mut Criterion) { - use rustix::time::{clock_gettime, ClockId}; - - c.bench_function("simple clock_gettime", |b| { - b.iter(|| { - let _ = clock_gettime(ClockId::Monotonic); - }) - }); - } - - #[cfg(not(target_os = "wasi"))] - pub(super) fn simple_clock_gettime_libc(c: &mut Criterion) { - c.bench_function("simple clock_gettime libc", |b| { - b.iter(|| { - let mut s = std::mem::MaybeUninit::::uninit(); - unsafe { - assert_eq!( - libc::clock_gettime(libc::CLOCK_MONOTONIC, s.as_mut_ptr()), - 0 - ); - let _ = s.assume_init(); - } - }) - }); - } - - #[cfg(not(target_os = "wasi"))] - pub(super) fn simple_getpid(c: &mut Criterion) { - use rustix::process::getpid; - - c.bench_function("simple getpid", |b| { - b.iter(|| { - let _ = getpid(); - }) - }); - } - - #[cfg(not(target_os = "wasi"))] - pub(super) fn simple_getpid_libc(c: &mut Criterion) { - c.bench_function("simple getpid libc", |b| { - b.iter(|| unsafe { - let _ = libc::getpid(); - }) - }); - } -} - -#[cfg(not(any( - not(criterion), - not(feature = "fs"), - not(feature = "process"), - not(feature = "time"), - windows, - target_os = "emscripten", - target_os = "redox", - target_os = "wasi", -)))] -criterion_group!( - benches, - suite::simple_statat, - suite::simple_statat_libc, - suite::simple_statat_libc_cstr, - suite::simple_statat_cstr, - suite::simple_clock_gettime, - suite::simple_clock_gettime_libc, - suite::simple_getpid, - suite::simple_getpid_libc -); -#[cfg(not(any( - not(criterion), - not(feature = "fs"), - not(feature = "process"), - not(feature = "time"), - windows, - target_os = "emscripten", - target_os = "redox", - target_os = "wasi", -)))] -criterion_main!(benches); diff --git a/tests/process/wait.rs b/tests/process/wait.rs index a1f25a631..2262eec33 100644 --- a/tests/process/wait.rs +++ b/tests/process/wait.rs @@ -1,6 +1,5 @@ use libc::{kill, SIGSTOP}; use rustix::process; -use serial_test::serial; use std::process::{Command, Stdio}; // These tests must execute serially to prevent race condition, where @@ -8,7 +7,7 @@ use std::process::{Command, Stdio}; // the tests to get stuck. #[test] -#[serial] +#[ignore] fn test_waitpid() { let child = Command::new("yes") .stdout(Stdio::null())