Support unix feature on OpenBSD (utmpx not supported)#5620
Support unix feature on OpenBSD (utmpx not supported)#5620sylvestre merged 11 commits intouutils:mainfrom
Conversation
2106c11 to
fccbc8c
Compare
fccbc8c to
23b7196
Compare
|
GNU testsuite comparison: |
|
Looks great to me. @tertsdiepraam what do you think? |
There was a problem hiding this comment.
I'm honestly not really sure about this. I don't really like to introduce utils that compile but don't work at all. That's because if someone installs uutils, it usually overrides the standard implementation. If we have a stub for, say, pinky, then the standard pinky gets overridden, so can't be used easily anymore. So I think disabling them in Cargo.toml until we support them makes more sense. I do agree that this is the right folder structure though. I just think we should tackle it one at a time by implementing them.
Why don't we start with a feature flag like this:
openbsd = [
"feat_Tier1",
#
"feat_require_crate_cpp",
"feat_require_unix",
"feat_require_unix_hostid",
]Then we can add the utils as they are implemented (and once all of them are done we set it to openbsd = ["unix"]). Maybe our feature flags in general are overdue for a refactor, too.
Also, I think other.rs should be called unix.rs or utmpx.rs :)
The first four commits are definitely good though!
I have already proposed a PR with this solution, @sylvestre rejected it and asked me to implement as in this PR. See PR#5613 My goal is to implement these 4 utils on OpenBSD, without using
OK, rename |
|
Alright, I talked with @sylvestre and we'll follow his plan! Thanks for working on this! |
- add target_os cfg for pline function - add target_os cfg for auditd function (void on OpenBSD)
- See issue uutils#5596 for details
- utmpx not supported on OpenBSD
- add src/uu/pinky/src/platform directory and platform/mod.rs for conditional compilation
according to target_os
- platform/openbsd.rs: implementation on OpenBSD (unsupported tool)
- platform/unix.rs: implementation on other OS
- src/uu/pinky/src/pinky.rs: use platform module for uucore::main function
- utmpx not supported on OpenBSD
- add src/uu/uptime/src/platform directory and platform/mod.rs for conditional compilation
according to target_os
- platform/openbsd.rs: implementation on OpenBSD (unsupported tool)
- platform/unix.rs: implementation on other OS
- src/uu/uptime/src/uptime.rs: use platform module for uucore::main function
- utmpx not supported on OpenBSD
- add src/uu/users/src/platform directory and platform/mod.rs for conditional compilation
according to target_os
- platform/openbsd.rs: implementation on OpenBSD (unsupported tool)
- platform/unix.rs: implementation on other OS
- src/uu/users/src/users.rs: use platform module for uucore::main function
- utmpx not supported on OpenBSD
- add src/uu/who/src/platform directory and platform/mod.rs for conditional compilation according
to target_os
- platform/openbsd.rs: implementation on OpenBSD (unsupported tool)
- platform/unix.rs: implementation on other OS
- src/uu/who/src/who.rs: use platform module for uucore::main function
23b7196 to
e1032e1
Compare
|
@sylvestre Build and tests OK on OpenBSD/amd64 with your 2 additional commits from c32e730 |
|
Super, merci :) |
|
Félicitations! |
utmpxsupport forpinky,users,uptimeandwhotools.utmpxis not supported on OpenBSD => add conditional compilation for these 4 tools to disable it and display "unsupported command on OpenBSD" when called.Fixes #5596
No regression on Linux : build OK with Rust v1.74.0 on Debian testing/amd64.
Tests on OpenBSD with feature "unix"