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
Closed
@lcheylus

Description

@lcheylus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0