-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support unix feature on OpenBSD (utmpx not supported) #5620
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
utmpx
support forpinky
,users
,uptime
andwho
tools.utmpx
is 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"