Skip to content
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

3.8.0 broken on FreeBSD #370

Closed
ydirson opened this issue Mar 13, 2024 · 4 comments · Fixed by #372
Closed

3.8.0 broken on FreeBSD #370

ydirson opened this issue Mar 13, 2024 · 4 comments · Fixed by #372

Comments

@ydirson
Copy link
Contributor

ydirson commented Mar 13, 2024

My CI picked up the new 3.8.0, and the FreeBSD jobs all fail:

  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_info-3.8.0/src/freebsd/mod.rs:11:19
   |
11 |     let version = uname()
   |                   ^^^^^-- an argument of type `&str` is missing
   |
note: function defined here
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_info-3.8.0/src/uname.rs:5:8
   |
5  | pub fn uname(arg: &str) -> Option<String> {
   |        ^^^^^ ---------
help: provide the argument
   |
11 |     let version = uname(/* &str */)
   |                        ~~~~~~~~~~~~
error[E0308]: mismatched types
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_info-3.8.0/src/freebsd/mod.rs:42:14
   |
40 |     match uname("-s") {
   |           ----------- this expression has type `Option<String>`
41 |         None => Type::Unknown,
42 |         Some("MidnightBSD") => Type::MidnightBSD,
   |              ^^^^^^^^^^^^^ expected `String`, found `&str`
error[E0308]: mismatched types
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_info-3.8.0/src/freebsd/mod.rs:43:14
   |
40 |     match uname("-s") {
   |           ----------- this expression has type `Option<String>`
...
43 |         Some("FreeBSD") => {
   |              ^^^^^^^^^ expected `String`, found `&str`
@stanislav-tkach
Copy link
Owner

Thank you for the report! Unfortunately, I have broken some things with the latest release. I will try to fix everything in the following patch.

@tankf33der
Copy link

I am on FreeBSD with os_info 3.8.1 and bug still here

...
...
   Compiling thrussh v0.34.0
   Compiling clap v4.5.3
   Compiling thrussh-config v0.6.0
   Compiling os_info v3.8.1
error[E0308]: mismatched types
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_info-3.8.1/src/freebsd/mod.rs:28:9
   |
27 |     match uname("-s").as_deref() {
   |           ---------------------- this expression has type `std::option::Option<&str>`
28 |         "MidnightBSD" => Type::MidnightBSD,
   |         ^^^^^^^^^^^^^ expected `Option<&str>`, found `&str`
   |
   = note:   expected enum `std::option::Option<&str>`
           found reference `&'static str`
help: try wrapping the pattern in `Some`
   |
28 |         Some("MidnightBSD") => Type::MidnightBSD,
   |         +++++             +

error[E0308]: mismatched types
  --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/os_info-3.8.1/src/freebsd/mod.rs:29:9
   |
27 |     match uname("-s").as_deref() {
   |           ---------------------- this expression has type `std::option::Option<&str>`
28 |         "MidnightBSD" => Type::MidnightBSD,
29 |         "FreeBSD" => {
   |         ^^^^^^^^^ expected `Option<&str>`, found `&str`
   |
   = note:   expected enum `std::option::Option<&str>`
           found reference `&'static str`
help: try wrapping the pattern in `Some`
   |
29 |         Some("FreeBSD") => {
   |         +++++         +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `os_info` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
$

@stanislav-tkach
Copy link
Owner

stanislav-tkach commented Mar 22, 2024

@tankf33der
Sorry for the inconvenience. I have published the 3.8.2 version and yanked both 3.8.0 and 3.8.1. I hope everything is OK now.

@tankf33der
Copy link

Works now, compiled ok. Issue closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants