Giter Site home page Giter Site logo

platform-info's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platform-info's Issues

Information retrieval is lossy

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).

machine returns x86_64 on Apple M2 (arm64)

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?

Dependency Dashboard

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.

Detected dependencies

cargo
Cargo.toml
  • regex 1
  • libc 0.2
  • winapi 0.3
github-actions
.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

  • Check this box to trigger a request for Renovate to run again on this repository

Ensure Windows code is correct

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.

Library can't be compiled on unknown platforms

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.

Fails to build on Freebsd

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

Add "other" platform

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.