-
Notifications
You must be signed in to change notification settings - Fork 739
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
Add Solaris operating system support (using flag mio_unsupported_forc… #1715
Conversation
Solaris and Illumos support a mechanism called event ports, which can be used to implement event listening in a more efficient way than |
Illumos already uses epoll, so this will be Solaris specific. |
48eceef
to
1e82cd8
Compare
How is that possible? So far I had to use RUSTFLAGS="--cfg mio_unsupported_force_poll_poll".
#1152 could be considered as resolved once this is merged in. Originally I was thinking about implementing it via Solaris event ports but it's not possible right now since we couln't check it using continous integration. #1328 my commit uses SOCK_CLOEXEC and SOCK_NONBLOCK as it's for Illumos. Solaris 10 will never support Rust. It's very old and now with mininal support. It was released in 2004. Not sure about others. I can modifiy README file and remove Solaris line. But mio_unsupported_force_poll_poll is mentined there as not really supported thing. |
By adding the correct
👍
I'm not familiar with Solaris, but do newer version have support for
Let's leave it for now, I want to make sure it actually works this time.
They key word in |
Sorry! I think I'm lost. What and where should I put anything? Thanks!
Yes, all versions of Solaris 11.4 (first release in 2018) do support them.
|
Try compiling without
👍 |
No it doesn't help:
|
Try enabling all features |
Sorry about with[out] RUSTFLAGS. It fails like this now. But still have no clue how to define
|
Well... you need to resolve those issues to ensure that Solaris works... |
1e82cd8
to
bc54006
Compare
Ok, with my new change Solaris builds without need to define |
@psumbera can you add some CI setup? |
Confused again. Where?
Solaris isn't supported by |
... I mean come on... At some point you have put the time in. It's really not that complicated once you find the GitHub Actions file.
Do you have any other means to add Solaris support to the CI? |
src/sys/unix/selector/mod.rs
Outdated
@@ -1,5 +1,5 @@ | |||
#[cfg(all( | |||
not(mio_unsupported_force_poll_poll), | |||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed as solaris
is not any of the targets listed below.
src/sys/unix/selector/mod.rs
Outdated
@@ -10,7 +10,7 @@ | |||
mod epoll; | |||
|
|||
#[cfg(all( | |||
not(mio_unsupported_force_poll_poll), | |||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again not needed.
src/sys/unix/selector/mod.rs
Outdated
pub(crate) use self::poll::{event, Event, Events, IoSourceState, Selector}; | ||
|
||
#[cfg(all( | ||
not(mio_unsupported_force_poll_poll), | ||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
src/sys/unix/selector/mod.rs
Outdated
@@ -42,7 +42,7 @@ pub(crate) use self::poll::{event, Event, Events, IoSourceState, Selector}; | |||
mod kqueue; | |||
|
|||
#[cfg(all( | |||
not(mio_unsupported_force_poll_poll), | |||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
src/sys/unix/waker.rs
Outdated
@@ -1,5 +1,5 @@ | |||
#[cfg(all( | |||
not(mio_unsupported_force_poll_poll), | |||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got following error without this change:
error: field `waker` is never read
--> src/sys/unix/waker.rs:38:9
|
37 | pub struct Waker {
| ----- field in this struct
38 | waker: WakerInternal,
| ^^^^^
|
= note: `Waker` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
note: the lint level is defined here
--> src/lib.rs:6:5
|
6 | dead_code
| ^^^^^^^^^
error: associated items `new` and `wake` are never used
--> src/sys/unix/waker.rs:42:16
|
41 | impl Waker {
| ---------- associated items in this implementation
42 | pub fn new(selector: &Selector, token: Token) -> io::Result<Waker> {
| ^^^
...
48 | pub fn wake(&self) -> io::Result<()> {
| ^^^^
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it uses pub use self::poll::Waker;
and thus cannot use pub use self::fdbased::Waker
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But on Solaris this attribute should never return true, even without the change made. I don't have time to look into it at the moment, but this change is not needed and only made the cfg attribute more complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Thomasdezeeuw How can possibly following attribute be false
on Solaris?
#[cfg(all(
not(mio_unsupported_force_poll_poll),
not(all(
not(mio_unsupported_force_waker_pipe),
any(
target_os = "freebsd",
target_os = "ios",
target_os = "macos",
target_os = "tvos",
target_os = "watchos",
)
))
))]
src/sys/unix/waker.rs
Outdated
@@ -13,7 +13,7 @@ | |||
))] | |||
mod fdbased { | |||
#[cfg(all( | |||
not(mio_unsupported_force_waker_pipe), | |||
not(any(target_os = "solaris", mio_unsupported_force_waker_pipe)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
src/sys/unix/waker.rs
Outdated
@@ -51,7 +52,7 @@ mod fdbased { | |||
} | |||
|
|||
#[cfg(all( | |||
not(mio_unsupported_force_poll_poll), | |||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got following error without this change:
error[E0432]: unresolved imports `self::fdbased`, `self::waker::Waker`
--> src/sys/unix/mod.rs:24:20
|
24 | pub(crate) use self::waker::Waker;
| ^^^^^^^^^^^^^^^^^^
|
::: src/sys/unix/waker.rs:66:15
|
66 | pub use self::fdbased::Waker;
| ^^^^^^^ could not find `fdbased` in `self`
src/sys/unix/waker.rs
Outdated
@@ -112,7 +113,7 @@ mod eventfd { | |||
} | |||
} | |||
|
|||
#[cfg(mio_unsupported_force_poll_poll)] | |||
#[cfg(any(target_os = "solaris", mio_unsupported_force_poll_poll))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed, but not 100% sure.
src/sys/unix/waker.rs
Outdated
@@ -138,7 +139,7 @@ mod eventfd { | |||
} | |||
|
|||
#[cfg(all( | |||
mio_unsupported_force_poll_poll, | |||
any(target_os = "solaris", mio_unsupported_force_poll_poll), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
src/sys/unix/waker.rs
Outdated
@@ -276,7 +278,7 @@ mod pipe { | |||
} | |||
|
|||
#[cfg(all( | |||
mio_unsupported_force_poll_poll, | |||
any(target_os = "solaris", mio_unsupported_force_poll_poll), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not need, you already added it below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got following errir without this change:
error[E0432]: unresolved import `crate::sys::unix::waker::WakerInternal`
--> src/sys/unix/selector/poll.rs:7:5
|
7 | use crate::sys::unix::waker::WakerInternal;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `WakerInternal` in `sys::unix::waker`
error: unused import: `AsRawFd`
--> src/sys/unix/selector/poll.rs:11:25
|
11 | use std::os::unix::io::{AsRawFd, RawFd};
| ^^^^^^^
|
note: the lint level is defined here
--> src/lib.rs:5:5
|
5 | unused_imports,
| ^^^^^^^^^^^^^^
7c90608
to
accc36b
Compare
Still confused. If you mean '.cirrus.yml'. Cirrus CI doesn't support Solaris OS.
No. |
@Thomasdezeeuw do you have any other commets or suggestions? Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Thomasdezeeuw do you have any other commets or suggestions? Thank you!
Ideally we can setup some kind of CI, but that doesn't seem likely.
Also some of the comments I made still need to be resolved, I see you answered them, but I think the warnings should we resolved in another way.
src/sys/unix/waker.rs
Outdated
@@ -1,5 +1,5 @@ | |||
#[cfg(all( | |||
not(mio_unsupported_force_poll_poll), | |||
not(any(target_os = "solaris", mio_unsupported_force_poll_poll)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But on Solaris this attribute should never return true, even without the change made. I don't have time to look into it at the moment, but this change is not needed and only made the cfg attribute more complex.
I need to clean up the |
accc36b
to
e80c3b2
Compare
@psumbera did you mean to close this? |
No. I'm now applying manually my changes on top of latest repo. I will push change to my repo later... |
Ok. I wasn't able to reuse this pull request. Instead I have to create #1724. |
…e_poll_poll)