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

add HermitOS support to branch v0.8.x #1775

Open
wants to merge 7 commits into
base: v0.8.x
Choose a base branch
from

Conversation

stlankes
Copy link
Contributor

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.

HermitOS is a library operating system. It it is partly compatible
to Unix. Consequently, the system interface to unix is revised
to support HermitOS.
@stlankes stlankes changed the title add support HermitOS to branch v0.8.x add HermitOS support to branch v0.8.x Apr 23, 2024
also the master branch disable these warnings
@stlankes
Copy link
Contributor Author

Hm, I think that the my changes aren't the reason for the clippy warnings

@Thomasdezeeuw
Copy link
Collaborator

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" }
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

@stlankes stlankes Apr 25, 2024

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.

Copy link
Contributor Author

@stlankes stlankes Apr 25, 2024

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",
Copy link
Collaborator

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?

Copy link
Contributor Author

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" }
Copy link
Collaborator

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.

src/sys/unix/mod.rs Outdated Show resolved Hide resolved
src/sys/unix/waker.rs Outdated Show resolved Hide resolved
src/sys/unix/waker.rs Outdated Show resolved Hide resolved
stlankes and others added 2 commits April 25, 2024 08:12
Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com>
Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com>
@Thomasdezeeuw
Copy link
Collaborator

I made some changes to the cfg of Hermit in #1789, this should be reflected when backporting to v0.8.

Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com>
@stlankes
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants