uutils / platform-info Goto Github PK
View Code? Open in Web Editor NEWA cross-platform way to get information about your machine
License: MIT License
A cross-platform way to get information about your machine
License: MIT License
Because we use OsStr::to_string_lossy()
and stuff like that, there's potential data loss. I'm not sure if we really care though (i.e. I doubt most people are using uname
and co. beyond operating system checks and the like).
Observed behavior: machine returns x86_64
.
Expected behavior: machine returns arm64
.
I recently switched from testing on an Intel Macbook Pro to an M2 chip, which is arm64. I noticed that platform-info is returning x86_64
, though, when I'd expect it to return arm64
. Am I just thinking about it wrong?
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
Cargo.toml
regex 1
libc 0.2
winapi 0.3
.github/workflows/ci.yml
actions/checkout v4
Swatinem/rust-cache v2
mozilla-actions/sccache-action v0.0.4
actions/checkout v4
Swatinem/rust-cache v2
mozilla-actions/sccache-action v0.0.4
DavidAnson/markdownlint-cli2-action v16
actions/checkout v4
streetsidesoftware/cspell-action v6
actions/checkout v4
Swatinem/rust-cache v2
mozilla-actions/sccache-action v0.0.4
actions/checkout v4
Swatinem/rust-cache v2
mozilla-actions/sccache-action v0.0.4
codecov/codecov-action v4
The return value of nodename()
returns a value with an erroneous trailing NUL character for WinOS.
I have a fix and will post a PR for it.
The Windows code is way more complicated than the Redox and Unix code for a variety of reasons. We need to verify that the code is compatible with uname
from GNU coreutils (or most GNU ports). Additionally, we need to check that all the code is indeed safe as it is filled with calls to the Windows API.
When trying to compile this library on an unknown platform the compiler errors out. This is an example of what happens on Illumos:
Compiling platform-info v2.0.1 (/root/platform-info)
error[E0425]: cannot find value `HOST_OS_NAME` in module `crate::lib_impl`
--> src/platform/unix.rs:57:53
|
57 | osname: OsString::from(crate::lib_impl::HOST_OS_NAME),
| ^^^^^^^^^^^^ not found in `crate::lib_impl`
For more information about this error, try `rustc --explain E0425`.
error: could not compile `platform-info` due to previous error
I've created the following PR which I think should fix the issue: #46.
When trying to update the rust coreutils, it fails with:
Checking fundu v0.5.1
error[E0609]: no field `domainname` on type `libc::utsname`
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/platform-info-2.0.0/src/platform/unix.rs:121:84
|
121 | debug_struct = debug_struct.field("domainname", &oss_from_cstr(&self.0.domainname));
| ^^^^^^^^^^ unknown field
|
= note: available fields are: `sysname`, `nodename`, `release`, `version`, `machine`
error[E0609]: no field `domainname` on type `libc::utsname`
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/platform-info-2.0.0/src/platform/unix.rs:146:38
|
146 | equal = equal && (self.0.domainname == other.0.domainname)
| ^^^^^^^^^^ unknown field
|
= note: available fields are: `sysname`, `nodename`, `release`, `version`, `machine`
error[E0609]: no field `domainname` on type `libc::utsname`
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/platform-info-2.0.0/src/platform/unix.rs:146:60
|
146 | equal = equal && (self.0.domainname == other.0.domainname)
| ^^^^^^^^^^ unknown field
|
https://github.com/uutils/coreutils/actions/runs/5073973837/jobs/9113647713?pr=4897
cc @rivy
Currently this crate and any of its dependencies fail to compile on e.g. Wasm32 targets.
I believe it would be useful to add a catch-all implementation of sys
that would just return "other" or "unknown" from all methods, to prevent at least compilation issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.