-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
uname: return processor type instead of "unknown" #8842
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
base: main
Are you sure you want to change the base?
Conversation
fcd941a
to
3d44a18
Compare
uname -p
returning "unknown"3d44a18
to
6e1f657
Compare
GNU testsuite comparison:
|
/// | ||
/// Fixes: <https://github.com/uutils/coreutils/issues/8659> | ||
fn map_processor(machine: &str) -> String { | ||
match machine { |
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.
what about merging this into https://crates.io/crates/platform-info ?
i have opened uutils/platform-info#96 to add the once that's merged and released, we can update this PR to use |
This is incorrect. GNU Coreutils returns On x86_64 GNU/Linux:
On aarch64 GNU/Linux:
See discussion on the history of this option discussed on the GNU Coreutils mailing list. [1] https://lists.gnu.org/archive/html/coreutils/2025-09/msg00236.html |
@collinfunk many thanks for the input :) |
I'm reframing this PR from "bug fix" to "feature enhancement". The original issue was resolved downstream (Ubuntu patched kdump-tools to use ref: https://bugs.launchpad.net/ubuntu/+source/coreutils-from/+bug/2122648 |
testing shows that the current behavior matches standard GNU coreutils: Standard GNU coreutils behavior (returning "unknown"): $ podman run --rm debian:latest uname -p
unknown
$ podman run --rm fedora:latest uname -p
unknown
$ podman run --rm alpine:latest uname -p
unknown With this PR applied (returning mapped values):
|
But why? No one uses The script that was fixed there was a Ubuntu invention that was added on top of Debian's
[1] https://launchpad.net/ubuntu/+source/kdump-tools/1:1.10.7ubuntu1 |
We don't judge the usage of an option. We want to be a full drop-in-replacement of GNU :) |
The issue that I have with this proposal is that it diverges from the longstanding behavior of GNU. Also
If anyone wants the processor type, they just use
If you look up
This extension will almost certainly break people's configurations. And it will likely break some [1] https://pubs.opengroup.org/onlinepubs/007908799/xcu/uname.html |
OK, I understand now your concerns. We should do the same then :) |
Enhance
uname -p
to return processor architecture information instead of "unknown".Currently
uname -p
always returns "unknown", making it useless:This PR makes it return meaningful information by mapping from machine architecture: