-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 Fuchsia support #37313
Add Fuchsia support #37313
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (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. |
@alexcrichton Note that this PR is dependent on rust-lang/libc#432 to actually work. It also requires a clang wrapper which has not yet been added to the fuchsia repository. Comments welcome. One missing piece is aarch64 support (it's x86_64 only for now), one of the two officially supported architectures for Fuchsia. But I figure it might be useful to get feedback at this stage. |
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.
Looks great to me! Let's get the libc PR merged as well yeah so it can be included here.
@@ -312,6 +312,7 @@ pub trait DirEntryExt { | |||
} | |||
|
|||
#[stable(feature = "dir_entry_ext", since = "1.1.0")] | |||
#[cfg(not(target_os = "fuchsia"))] |
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.
We chatted on IRC, but perhaps this can be removed now?
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.
Yup, fixed.
pub use libc::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t}; | ||
} | ||
|
||
#[cfg(target_arch = "aarch64")] |
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.
You can probably simplify a bunch of this right as only x86_64 is needed for now?
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 chose these based on what's plausibly supported by the Magenta kernel. aarch64 is an officially supported Fuchsia target, and I'd like to get that in soon (possibly as an update to his PR). Magenta kernel also supports 32 bit targets, and I don't want to necessarily preclude Rust on those targets either.
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 never mind me then!
Oh looks like |
Want to update the libc submodule now as well? |
@bors: r+ |
☔ The latest upstream changes (presumably #37337) made this pull request unmergeable. Please resolve the merge conflicts. |
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
The DirEntryExt::ino() implementation was omitted from the first iteration of this patch, because a dependency needed to be configured. The fix is straightforward enough.
Prefer FIXME to TODO
Also trim os::fuchsia::raw architectures.
@bors: r+ |
📌 Commit cea6140 has been approved by |
Add Fuchsia support Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
Adds support for the x86_64-unknown-fuchsia target, which covers the
Fuchsia operating system.