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

Doesn't compile on Illumos #12

Closed
DrHyde opened this issue Feb 21, 2022 · 7 comments
Closed

Doesn't compile on Illumos #12

DrHyde opened this issue Feb 21, 2022 · 7 comments
Labels
platform support Requests to support a new platform

Comments

@DrHyde
Copy link

DrHyde commented Feb 21, 2022

Illumos is the open source fork of Solaris.

While trying to build Starship https://starship.rs/ I get ...

$ cargo build
   Compiling process_control v3.2.1
error[E0432]: unresolved import `libc::CLD_EXITED`
  --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/process_control-3.2.1/src/unix.rs:17:5
   |
17 | use libc::CLD_EXITED;
   |     ^^^^^^^^^^^^^^^^ no `CLD_EXITED` in the root

error[E0277]: the trait bound `i32: From<u32>` is not satisfied
   --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/process_control-3.2.1/src/unix.rs:239:29
    |
239 |                         pid.into(),
    |                             ^^^^ the trait `From<u32>` is not implemented for `i32`
    |
    = help: the following implementations were found:
              <i32 as From<NonZeroI32>>
              <i32 as From<bool>>
              <i32 as From<i16>>
              <i32 as From<i8>>
            and 2 others
    = note: required because of the requirements on the impl of `Into<i32>` for `u32`

error[E0599]: no method named `si_status` found for struct `siginfo_t` in the current scope
   --> /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/process_control-3.2.1/src/unix.rs:249:58
    |
249 | ...                   value: unsafe { process_info.si_status() },
    |                                                    ^^^^^^^^^ method not found in `siginfo_t`

Some errors have detailed explanations: E0277, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `process_control` due to 3 previous errors

which looks at least a bit like it might be related to #4

I realise that this is a Weird Platform, so if you need it I expect I can set up a guest account if that would help with debugging.

@dylni
Copy link
Owner

dylni commented Feb 22, 2022

Thank you for this issue! The primary reason for the compilation errors is missing definitions from libc: rust-lang/libc#2696

If that pull request is merged once issues are fixed, I will update the implementation here and release a new version with support for this platform.

@DrHyde
Copy link
Author

DrHyde commented Feb 22, 2022

Thanks!

@dylni dylni added blocked Blocked on an issue or dependency bug Something isn't working labels Feb 22, 2022
@pfmooney
Copy link

I tested with my pending rust-lang/libc#2697 patch, and the build was content, except for the id_t type issue noted at L239. Although most platforms use u32 for id_t, illumos and a few others use something different. I suspect some TryInto handling would address that in a platform neutral manner.

@dylni
Copy link
Owner

dylni commented Feb 23, 2022

@pfmooney Thank you, and thank you for testing the fix!

You're right that the implementation here does need to be adjusted. Unfortunately, the return type of Child::id makes it unclear whether TryInto or as is always the right answer. I'll be looking into the standard library implementations a bit more to see which would be the best option.

@dylni
Copy link
Owner

dylni commented Feb 24, 2022

The implementation has been updated for this crate and compiles successfully with the changes in libc. Once a libc version is released with rust-lang/libc#2697, I will verify the fix and release a new version with an updated libc requirement.

@dylni dylni closed this as completed in 837c6ed Mar 15, 2022
@dylni dylni removed the blocked Blocked on an issue or dependency label Mar 15, 2022
@dylni
Copy link
Owner

dylni commented Mar 15, 2022

Version 3.3.0 has been published with Illumos support. Thanks for reporting the issue!

@DrHyde
Copy link
Author

DrHyde commented Mar 15, 2022

Thanks!

@dylni dylni added platform support Requests to support a new platform and removed bug Something isn't working labels Apr 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform support Requests to support a new platform
Projects
None yet
Development

No branches or pull requests

3 participants