From 145c240cfac980db0cce774b9a5f438afc94342a Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 9 Apr 2022 16:32:39 -0600 Subject: [PATCH 1/2] Use singular number for all feature names features => feature users => user Neither of these features have yet been included in a release, so it's ok to rename them. --- Cargo.toml | 8 ++++---- src/lib.rs | 6 +++--- src/sys/mod.rs | 2 +- src/unistd.rs | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1e2aad22cd..8842fc90e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,11 +36,11 @@ memoffset = { version = "0.6.3", optional = true } [features] default = [ - "acct", "aio", "dir", "env", "event", "features", "fs", + "acct", "aio", "dir", "env", "event", "feature", "fs", "hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue", "net", "personality", "poll", "process", "pthread", "ptrace", "quota", "reboot", "resource", "sched", "signal", "socket", "term", "time", - "ucontext", "uio", "users", "zerocopy", + "ucontext", "uio", "user", "zerocopy", ] acct = [] @@ -48,7 +48,7 @@ aio = [] dir = ["fs"] env = [] event = [] -features = [] +feature = [] fs = [] hostname = [] inotify = [] @@ -73,7 +73,7 @@ term = [] time = [] ucontext = ["signal"] uio = [] -users = ["features"] +user = ["feature"] zerocopy = ["fs", "uio"] [dev-dependencies] diff --git a/src/lib.rs b/src/lib.rs index 172ca3a1d5..d4dcbc4ceb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,7 +12,7 @@ //! * `dir` - Stuff relating to directory iteration //! * `env` - Manipulate environment variables //! * `event` - Event-driven APIs, like `kqueue` and `epoll` -//! * `features` - Query characteristics of the OS at runtime +//! * `feature` - Query characteristics of the OS at runtime //! * `fs` - File system functionality //! * `hostname` - Get and set the system's hostname //! * `inotify` - Linux's `inotify` file system notification API @@ -37,7 +37,7 @@ //! * `time` - Query the operating system's clocks //! * `ucontext` - User thread context //! * `uio` - Vectored I/O -//! * `users` - Stuff relating to users and groups +//! * `user` - Stuff relating to users and groups //! * `zerocopy` - APIs like `sendfile` and `copy_file_range` #![crate_name = "nix"] #![cfg(unix)] @@ -75,7 +75,7 @@ feature! { #[allow(missing_docs)] pub mod errno; feature! { - #![feature = "features"] + #![feature = "feature"] #[deny(missing_docs)] pub mod features; diff --git a/src/sys/mod.rs b/src/sys/mod.rs index 151d9e9d08..e5639f20ab 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -177,7 +177,7 @@ feature! { } feature! { - #![feature = "features"] + #![feature = "feature"] pub mod utsname; } diff --git a/src/unistd.rs b/src/unistd.rs index 272fb0cd9d..764b3dee43 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -45,7 +45,7 @@ pub use self::setres::*; pub use self::getres::*; feature! { -#![feature = "users"] +#![feature = "user"] /// User identifier /// @@ -591,7 +591,7 @@ pub fn symlinkat( // Double the buffer capacity up to limit. In case it already has // reached the limit, return Errno::ERANGE. -#[cfg(any(feature = "fs", feature = "users"))] +#[cfg(any(feature = "fs", feature = "user"))] fn reserve_double_buffer_size(buf: &mut Vec, limit: usize) -> Result<()> { use std::cmp::min; @@ -654,7 +654,7 @@ pub fn getcwd() -> Result { } feature! { -#![all(feature = "users", feature = "fs")] +#![all(feature = "user", feature = "fs")] /// Computes the raw UID and GID values to pass to a `*chown` call. // The cast is not unnecessary on all platforms. @@ -1348,7 +1348,7 @@ pub fn fdatasync(fd: RawFd) -> Result<()> { } feature! { -#![feature = "users"] +#![feature = "user"] /// Get a real user ID /// @@ -1432,7 +1432,7 @@ pub fn setgid(gid: Gid) -> Result<()> { } feature! { -#![all(feature = "fs", feature = "users")] +#![all(feature = "fs", feature = "user")] /// Set the user identity used for filesystem checks per-thread. /// On both success and failure, this call returns the previous filesystem user /// ID of the caller. @@ -1457,7 +1457,7 @@ pub fn setfsgid(gid: Gid) -> Gid { } feature! { -#![feature = "users"] +#![feature = "user"] /// Get the list of supplementary group IDs of the calling process. /// @@ -1868,7 +1868,7 @@ pub fn mkstemp(template: &P) -> Result<(RawFd, PathBuf)> { } feature! { -#![all(feature = "fs", feature = "features")] +#![all(feature = "fs", feature = "feature")] /// Variable names for `pathconf` /// @@ -2064,7 +2064,7 @@ pub fn pathconf(path: &P, var: PathconfVar) -> Result(path: &P, amode: AccessFlags) -> Result<()> { } feature! { -#![feature = "users"] +#![feature = "user"] /// Representation of a User, based on `libc::passwd` /// @@ -3212,7 +3212,7 @@ pub fn ttyname(fd: RawFd) -> Result { } feature! { -#![all(feature = "socket", feature = "users")] +#![all(feature = "socket", feature = "user")] /// Get the effective user ID and group ID associated with a Unix domain socket. /// From 23f18dfc18929965c95e0bcbdb8731645f07e401 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 9 Apr 2022 17:03:57 -0600 Subject: [PATCH 2/2] Pin nightly compiler used in CI for uclibc Workaround for https://github.com/rust-lang/rust/issues/95866 --- .cirrus.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index cc5f216da5..fdb65658f9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -286,14 +286,29 @@ task: - name: OpenBSD x86_64 env: TARGET: x86_64-unknown-openbsd - - name: Linux armv7 uclibceabihf - env: - TARGET: armv7-unknown-linux-uclibceabihf setup_script: - rustup component add rust-src << : *BUILD before_cache_script: rm -rf $CARGO_HOME/registry/index +# uclibc needs its own task for now, due to Rust bug 95866 +# https://github.com/rust-lang/rust/issues/95866 +task: + name: Linux armv7 uclibceabihf + container: + image: rustlang/rust:nightly + env: + BUILD: check + ZFLAGS: -Zbuild-std + TARGET: armv7-unknown-linux-uclibceabihf + TOOLCHAIN: nightly-2022-04-01 + setup_script: + - rustup toolchain install $TOOLCHAIN --profile minimal + - rustup component add --toolchain $TOOLCHAIN rust-src + - rustup component add --toolchain $TOOLCHAIN clippy + << : *BUILD + before_cache_script: rm -rf $CARGO_HOME/registry/index + # Test that we can build with the lowest version of all dependencies. # "cargo test" doesn't work because some of our dev-dependencies, like # rand, can't build with their own minimal dependencies.