-
Notifications
You must be signed in to change notification settings - Fork 1k
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 HermitCore support even if it doesn't have a UNIX interface #1292
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
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.
Thank you for the PR fellow Aachener!
I think you should add two hermit targets (x86_64
and aarch64
) to the ci/build.sh
file in this PR. You can use xargo
to cross-compile libc
to hermit
by providing two json target specification files.
That's far from what's required to be sure that this change is correct, but it is the minimum required to prevent other people, including yourself, from ensuring that libc
"at least compiles" for these targets.
If you need help with adding these build tests to CI, i'm on Discord and Zulip.
You are right. I oversaw the redefinition and the typo. Until now, HermitCore war missing in |
There is no tutorial, but that you are already using xargo is great. I assume that you pass If so, it should be enough to add the targets here: https://github.com/rust-lang/libc/blob/master/ci/build.sh#L169 And to copy the json files in the You probably want to try that locally. For that the best you can do is put them as the first two targets of that environment variable, and comment this other loop (https://github.com/rust-lang/libc/blob/master/ci/build.sh#L163) so that only the "no core" targets get tested. |
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 this LGTM. We'll see what CI says but the targets have a spec in https://github.com/rust-lang/rust/tree/master/src/librustc_target/spec so they should "just work".
Please feel free to ping me when CI is green, or if any of the build jobs stalls and needs to be restarted :)
src/unix/hermit/mod.rs
Outdated
@@ -19,7 +19,9 @@ | |||
pub type c_long = i64; | |||
pub type c_ulong = u64; | |||
|
|||
#[allow(unused)] |
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 this is weird, the only way in which these could be unused is if they are not exported by the library API, right?
@bors: r+ |
📌 Commit 14353e8 has been approved by |
add HermitCore support even if it doesn't have a UNIX interface Currently, we redefine the interface between the HermitCore kernel (https://hermitcore.org) and Rust’s standard library. In the future, it will not depend on a POSIX-compatible C library. Consequently, we add the support of HermitCore if the "unix" environment isn’t set. It will be great to integrate this patch because it would simplify our development. The classical interface is still supported and part of the subdirectory "unix".
☀️ Test successful - checks-cirrus, checks-travis, status-appveyor |
Hermit updates This PR does three things related to the Hermit target: 1. Close #3318. Non-unix Hermit has been supported since #1292 and unix Hermit does not exist anymore. 2. Update Hermit docs. [HermitCore/RustyHermit has been renamed to just Hermit.](https://rust-osdev.com/this-month/2023-08/#hermit-os-kernel) I took the chance to simplify the Hermit module's docs. 3. Add the `riscv64gc-unknown-hermit` target to docs and CI (rust-lang/rust#114004).
Currently, we redefine the interface between the HermitCore kernel (https://hermitcore.org) and Rust’s standard library. In the future, it will not depend on a POSIX-compatible C library. Consequently, we add the support of HermitCore if the "unix" environment isn’t set. It will be great to integrate this patch because it would simplify our development. The classical interface is still supported and part of the subdirectory "unix".