-
Notifications
You must be signed in to change notification settings - Fork 743
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 HermitOS support to branch v0.8.x #1775
Conversation
HermitOS is a library operating system. It it is partly compatible to Unix. Consequently, the system interface to unix is revised to support HermitOS.
also the master branch disable these warnings
Hm, I think that the my changes aren't the reason for the clippy warnings |
You can ignore the Clippy warnings. |
@@ -48,6 +48,9 @@ log = { version = "0.4.8", optional = true } | |||
[target.'cfg(unix)'.dependencies] | |||
libc = "0.2.149" | |||
|
|||
[target.'cfg(target_os = "hermit")'.dependencies] | |||
libc = { package = "hermit-abi", version = "0.3.9" } |
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.
So, we're using hermit-abi
as libc
? That's rather misleading.
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 just realised I accept it on master, that was a mistake.
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 can rename it to hermit_abi
. Should we also rename src/sys/unix
to src/sys/hermit
because the prefix libc
is often used in this directory. But the code is more or less identical. Also in other parts of the prefix is often used and code is identical.
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.
Ah, I have an idea to solve it. I will revise it.
@@ -81,6 +84,7 @@ targets = [ | |||
"x86_64-unknown-linux-gnu", | |||
"x86_64-unknown-netbsd", | |||
"x86_64-unknown-openbsd", | |||
"x86_64-unknown-hermit", |
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.
Can you add this to the CI and the Makefile as well?
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.
Yes, I will do it.
@@ -48,6 +48,9 @@ log = { version = "0.4.8", optional = true } | |||
[target.'cfg(unix)'.dependencies] | |||
libc = "0.2.149" | |||
|
|||
[target.'cfg(target_os = "hermit")'.dependencies] | |||
libc = { package = "hermit-abi", version = "0.3.9" } |
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 just realised I accept it on master, that was a mistake.
Co-authored-by: Thomas de Zeeuw <[email protected]>
Co-authored-by: Thomas de Zeeuw <[email protected]>
I made some changes to the |
Co-authored-by: Thomas de Zeeuw <[email protected]>
Looks good for me. By the way, we try to move parts of ABI to libc (see rust-lang/libc#3724). At least the stabilized interfaced should be moved to libc. |
This reverts commit a8a5c5b.
I have to revert a8a5c5b We don't return always -1. It could be also other negative values. I wait also for rust-lang/libc#3766 to be part of libc 0.2. |
Should we also fix that in v1: Lines 5 to 15 in 1ce1545
👍 also like to make this change in v1. Is the main aim of this to support Tokio? Because if so, it might make more sense to merge tokio-rs/tokio#6635 instead. |
The code in v1 is correct and similar to the current version in 0.8.
Yes! What is the current state of tokio-rs/tokio#6635 ? |
The summary I gave in tokio-rs/tokio#6635 (comment) is still accurate. I am on vacation right now. |
Then you should not be reading emails/GitHub, but enjoying your vacation instead ;) |
I think, we can close this PR. mio 1.0 is already used by tokio |
Backport of #1759
HermitOS is a library operating system. The handling of the socket streams is compatible to unix. However, other parts are not compatible to Unix. Consequently, HermitOS doesn't belong to the unix family.
To support MIO, MIO's unix is revised to support HermitOS. Currently, the implementation based on the unix system poll.