bb icon indicating copy to clipboard operation
bb copied to clipboard

Compiling on NetBSD

Open ghost opened this issue 5 years ago • 2 comments

I'm trying to compile bb on NetBSD and I'm getting the following,

...

Compiling crossbeam v0.7.2
error[E0308]: mismatched types
  --> src/main.rs:86:54
   |
86 |                 libc::getpwuid_r(pw_uid, &mut pwent, buffer, 16384, &mut pwentp);
   |                                                      ^^^^^^ expected `i8`, found array `[i8; 16384]`
   |
   = note:    expected raw pointer `*mut i8`
           found mutable reference `&mut [i8; 16384]`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: could not compile `bb`.

To learn more, run the command again with --verbose.
*** Error code 101

Any clue? Thanks.

ghost avatar Nov 25 '20 13:11 ghost

Hello, this is because bb is using linux's libc crate version without any target platform checks.

Even if this was patched, bb relies on procfs; I see here it might be available on NetBSD, I will try setting up a VM to check this out.

epilys avatar Nov 25 '20 13:11 epilys

Thank you for your prompt reply. The reason I even tried was that in main.rs I found


target_os = "macos",
            target_os = "ios",
            target_os = "freebsd",
            target_os = "dragonfly",
            target_os = "openbsd",
            target_os = "netbsd"

Please let me know the outcome of your attempt. Thank you.

ghost avatar Nov 25 '20 13:11 ghost