From ad809958f02bd72b09bda3fb068e4815222ea698 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sun, 25 Oct 2026 11:05:20 +0000 Subject: [PATCH 1/2] ci(openbsd): update feature matrix to avoid feat_require_unix_utmpx utmpx not supported for opensbd --- .github/workflows/openbsd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/openbsd.yml b/.github/workflows/openbsd.yml index 73120728818..697b2aaf7a8 100644 --- a/.github/workflows/openbsd.yml +++ b/.github/workflows/openbsd.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: job: - - { features: unix } + - { features: "feat_Tier1,feat_require_unix" } steps: - uses: actions/checkout@v7.0.1 with: @@ -126,7 +126,7 @@ jobs: fail-fast: false matrix: job: - - { features: unix } + - { features: "feat_Tier1,feat_require_unix" } steps: - uses: actions/checkout@v7.0.1 with: From 024472918ba45cbab2705c2b33280f5b20bc957f Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 16 Oct 2026 15:32:33 +0100 Subject: [PATCH 2/2] build(who): gate by target support --- src/uu/who/Cargo.toml | 3 ++- src/uu/who/locales/en-US.ftl | 3 --- src/uu/who/locales/fr-FR.ftl | 3 --- src/uu/who/src/platform/mod.rs | 8 +------- src/uu/who/src/platform/openbsd.rs | 17 ----------------- src/uu/who/src/who.rs | 8 ++++++++ 6 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 src/uu/who/src/platform/openbsd.rs diff --git a/src/uu/who/Cargo.toml b/src/uu/who/Cargo.toml index c3c36788106..ceacbe5706e 100644 --- a/src/uu/who/Cargo.toml +++ b/src/uu/who/Cargo.toml @@ -18,7 +18,7 @@ path = "src/who.rs" test = false doctest = false -[dependencies] +[target.'cfg(any(target_vendor = "apple", target_os = "cygwin", target_os = "freebsd", target_os = "linux", target_os = "netbsd"))'.dependencies] clap = { workspace = true } fluent = { workspace = true } rustix = { workspace = true, features = ["fs", "termios"] } @@ -33,3 +33,4 @@ workspace = true [[bin]] name = "who" path = "src/main.rs" +required-features = ["uucore/default"] diff --git a/src/uu/who/locales/en-US.ftl b/src/uu/who/locales/en-US.ftl index 2984c2fdcc5..cca15b31852 100644 --- a/src/uu/who/locales/en-US.ftl +++ b/src/uu/who/locales/en-US.ftl @@ -54,6 +54,3 @@ who-heading-exit = EXIT # Error messages who-canonicalize-error = failed to canonicalize { $host } - -# Platform-specific messages -who-unsupported-openbsd = unsupported command on OpenBSD diff --git a/src/uu/who/locales/fr-FR.ftl b/src/uu/who/locales/fr-FR.ftl index 0c853e51ee9..5cfb7c2d233 100644 --- a/src/uu/who/locales/fr-FR.ftl +++ b/src/uu/who/locales/fr-FR.ftl @@ -53,6 +53,3 @@ who-heading-exit = SORTIE # Error messages who-canonicalize-error = échec de canonicalisation de { $host } - -# Platform-specific messages -who-unsupported-openbsd = commande non prise en charge sur OpenBSD diff --git a/src/uu/who/src/platform/mod.rs b/src/uu/who/src/platform/mod.rs index e0e87dca1bf..906b7e7dbb9 100644 --- a/src/uu/who/src/platform/mod.rs +++ b/src/uu/who/src/platform/mod.rs @@ -3,12 +3,6 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -#[cfg(not(target_os = "openbsd"))] mod unix; -#[cfg(not(target_os = "openbsd"))] -pub use self::unix::*; -#[cfg(target_os = "openbsd")] -mod openbsd; -#[cfg(target_os = "openbsd")] -pub use self::openbsd::*; +pub use self::unix::*; diff --git a/src/uu/who/src/platform/openbsd.rs b/src/uu/who/src/platform/openbsd.rs deleted file mode 100644 index f5871382b11..00000000000 --- a/src/uu/who/src/platform/openbsd.rs +++ /dev/null @@ -1,17 +0,0 @@ -// This file is part of the uutils coreutils package. -// -// For the full copyright and license information, please view the LICENSE -// file that was distributed with this source code. - -// Specific implementation for OpenBSD: tool unsupported (utmpx not supported) - -use crate::uu_app; - -use uucore::error::UResult; -use uucore::translate; - -pub fn uumain(args: impl uucore::Args) -> UResult<()> { - let _matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?; - println!("{}", translate!("who-unsupported-openbsd")); - Ok(()) -} diff --git a/src/uu/who/src/who.rs b/src/uu/who/src/who.rs index e82990b7924..6ca983200e9 100644 --- a/src/uu/who/src/who.rs +++ b/src/uu/who/src/who.rs @@ -5,6 +5,14 @@ // spell-checker:ignore (ToDO) runlevel mesg +#![cfg(any( + target_vendor = "apple", + target_os = "cygwin", + target_os = "freebsd", + target_os = "linux", + target_os = "netbsd" +))] + use clap::{Arg, ArgAction, Command}; use uucore::format_usage; use uucore::translate;