Open yurivict opened 8 months ago
For aarch64 (and also powerpc64 and powerpc64le), the problem is because those architectures use unsigned char by default, but there are lots of signed char definitions, e.g.:
pub moretdname: [i8; MAXCOMLEN as usize - TDNAMLEN as usize + 1],
An example for a fix is https://github.com/PonasKovas/rlaunch/commit/2f73499553d4a14840ed4e092a0c93fe1e928c64
Basically, you need to use c_char
type instead of i8
.
Thank you for your suggestion.
I changed from i8
to c_char
.
Could you try cargo test
at the latest revision of this repository?
Better, but there are still some errors.
nice
is still i8
strictly. See src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
in libc crate.kvm_openfiles()
function as a fifth parameter takes a c_char
, but the passed errbuf is i8
, which causes similar issue. I tried switching to u8
for my usecase (obviously needs to be done better, but I don't really know Rust) and bsd-kvm compiled, although procs still didn't, but let's fix this one first.I fixed the type of nice
and errbuf
.
Could you provide the error of procs compilation?
error[E0308]: mismatched types
--> src/./columns/command.rs:111:48
|
111 | let comm = crate::util::i8_to_cstr(proc.curr_proc.info.comm.as_ref());
| ----------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i8]`, found `&[u8]`
| |
| arguments to this function are incorrect
|
= note: expected reference `&[i8]`
found reference `&[u8]`
note: function defined here
--> src/util.rs:358:8
|
358 | pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, std::ffi::FromBytesUntilNulError> {
| ^^^^^^^^^^ --------
error[E0308]: mismatched types
--> src/./columns/file_name.rs:45:44
|
45 | let comm = crate::util::i8_to_cstr(proc.curr_proc.info.comm.as_ref());
| ----------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i8]`, found `&[u8]`
| |
| arguments to this function are incorrect
|
= note: expected reference `&[i8]`
found reference `&[u8]`
note: function defined here
--> src/util.rs:358:8
|
358 | pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, std::ffi::FromBytesUntilNulError> {
| ^^^^^^^^^^ --------
error[E0308]: mismatched types
--> src/./columns/state.rs:125:63
|
125 | if (flag & libc::P_WEXIT as i64) != 0 && info.stat != libc::SZOMB as i8 {
| --------- ^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
| |
| expected because this is `u8`
|
help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
|
125 | if (flag & libc::P_WEXIT as i64) != 0 && info.stat != (libc::SZOMB as i8).try_into().unwrap() {
| + +++++++++++++++++++++
error[E0308]: mismatched types
--> src/./columns/wchan.rs:48:70
|
48 | let raw_content = if let Ok(wmesg) = crate::util::i8_to_cstr(&proc.curr_proc.info.wmesg) {
| ----------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&[i8]`, found `&[u8; 9]`
| |
| arguments to this function are incorrect
|
= note: expected reference `&[i8]`
found reference `&[u8; 9]`
note: function defined here
--> src/util.rs:358:8
|
358 | pub fn i8_to_cstr(x: &[i8]) -> Result<&std::ffi::CStr, std::ffi::FromBytesUntilNulError> {
| ^^^^^^^^^^ --------
For more information about this error, try `rustc --explain E0308`.
error: could not compile `procs` (bin "procs") due to 4 previous errors
I fixed procs: https://github.com/dalance/procs/commit/ef802bc5cb6ce83ace37d4fe82895f870570a960. Could you try it?
Thanks, this makes procs build on powerpc64.
I released bsd-kvm v0.1.3 and procs v0.14.4.
@dalance
Here is the fresh failure of the sysutils/procs
port with bsd-kvm-0.1.4
.
@yurivict I've released bsd-kvm-0.1.5. Could you try it?
Unfortunately I don't have access to the i386 system, so I can't try it. The failures occur on the build servers.
On arm64 the error is:
rust-1.73.0 FreeBSD 13.2