8000 No support of utmpx on OpenBSD · Issue #5596 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

No support of utmpx on OpenBSD #5596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lcheylus opened this issue Nov 29, 2023 · 2 comments · Fixed by #5620
Closed

No support of utmpx on OpenBSD #5596

lcheylus opened this issue Nov 29, 2023 · 2 comments · Fixed by #5620

Comments

@lcheylus
Copy link
Contributor
lcheylus commented Nov 29, 2023

Following issue #5448

On OpenBSD-current (future version 7.5) on amd64, with Rust 1.73.0,

$ sysctl kern.version
kern.version=OpenBSD 7.4-current (GENERIC) #1356: Sun Oct 22 13:03:10 MDT 2023
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
$ rustc -V
rustc 1.73.0 (cc66ad468 2023-10-03) (built from a source tarball)

$ git rev-parse HEAD
769eb29cd3503d7734776572f7875a864c847c92

uucore build fails using unix feature:

$ cargo build --release --features unix
   Compiling uucore v0.0.22 (/home/fox/dev/coreutils.git/src/uucore)
error[E0432]: unresolved import `libc::endutxent`
  --> src/uucore/src/lib/features/utmpx.rs:43:9
   |
43 | pub use libc::endutxent;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `endpwent`
   |         no `endutxent` in the root

error[E0432]: unresolved import `libc::getutxent`
  --> src/uucore/src/lib/features/utmpx.rs:44:9
   |
44 | pub use libc::getutxent;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `getpwent`
   |         no `getutxent` in the root

error[E0432]: unresolved import `libc::setutxent`
  --> src/uucore/src/lib/features/utmpx.rs:45:9
   |
45 | pub use libc::setutxent;
   |         ^^^^^^---------
   |         |     |
   |         |     help: a similar name exists in the module: `setpwent`
   |         no `setutxent` in the root

error[E0432]: unresolved import `libc::utmpx`
  --> src/uucore/src/lib/features/utmpx.rs:46:5
   |
46 | use libc::utmpx;
   |     ^^^^^^^^^^^ no `utmpx` in the root
   |
help: a similar name exists in the module
   |
46 | use libc::utmp;
   |           ~~~~
help: consider importing this module through its public re-export instead
   |
46 | use crate::utmpx;
   |     ~~~~~~~~~~~~

error[E0432]: unresolved import `self::ut`
  --> src/uucore/src/lib/features/utmpx.rs:42:15
   |
42 | pub use self::ut::*;
   |               ^^ could not find `ut` in `self`

error[E0573]: expected type, found module `utmpx`
   --> src/uucore/src/lib/features/utmpx.rs:160:12
    |
160 |     inner: utmpx,
    |            ^^^^^ not a type

error[E0573]: expected type, found module `utmpx
   --> src/uucore/src/lib/features/utmpx.rs:214:32
    |
159 | pub struct Utmpx {
    | ---------------- similarly named struct `Utmpx` defined here
...
214 |     pub fn into_inner(self) -> utmpx {
    |                                ^^^^^ help: a struct with a similar name exists (notice the capitalization): `Utmpx`

error[E0425]: cannot find value `USER_PROCESS` in this scope
   --> src/uucore/src/lib/features/utmpx.rs:218:58
    |
218 |         !self.user().is_empty() && self.record_type() == USER_PROCESS
    |                                                          ^^^^^^^^^^^^ not found in this scope

error[E0308]: mismatched types
   --> src/uucore/src/lib/features/fs.rs:122:16

There is no support of utmpx on OpenBSD (only support for utmp) and accordingly, no support in libc crate.

To fix this issue, I propose to create a specific feature in Cargo.toml for OpenBSD to disable use of utmpx : don't include feat_require_unix_utmpx in this new feature.

I have a pending branch with this addition and other commits to fix build on OpenBSD without using utmpx. I will submit a PR when my work is finished for build and tests.

@tertsdiepraam
Copy link
Member
tertsdiepraam commented Nov 29, 2023

Sounds good! As a semi-related question, does that mean we can't support these utilities on openbsd or should we just implement them in a different way?

Edit: I did some digging and we indeed need to implement them some other way on OpenBSD.

@lcheylus
Copy link
Contributor Author

Sounds good! As a semi-related question, does that mean we can't support these utilities on openbsd or should we just implement them in a different way?

Edit: I did some digging and we indeed need to implement them some other way on OpenBSD.

Yes, tools with utmpx required (pinky, uptime, users, who) need to be implemented in another way on OpenBSD. I will work on it after fix for this issue.

lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 3, 2023
  - build.rs: add openbsd in krate list
  - Cargo.toml: add feature openbsd => no utmpx support

  - Fixes uutils#5596

Signed-off-by: Laurent Cheylus <foxy@free.fr>
lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 4, 2023
  - See issue uutils#5596 for details

Signed-off-by: Laurent Cheylus <foxy@free.fr>
lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 5, 2023
  - See issue uutils#5596 for details

Signed-off-by: Laurent Cheylus <foxy@free.fr>
lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 9, 2023
  - See issue uutils#5596 for details

Signed-off-by: Laurent Cheylus <foxy@free.fr>
lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 10, 2023
lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 11, 2023
lcheylus added a commit to lcheylus/rust-coreutils that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants
0