Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRedox Support Preview #37702
Conversation
jackpot51
added some commits
Oct 28, 2016
rust-highfive
assigned
aturon
Nov 11, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (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. |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton @brson @eddyb I am mentioning you here because you have expressed interest in a Redox Previous discussion here: https://internals.rust-lang.org/t/redox-support-in-liblibc-and-libstd/3954/17 |
jackpot51
reviewed
Nov 11, 2016
| @@ -34,7 +34,6 @@ pub mod condvar; | |||
| pub mod io; | |||
| pub mod memchr; | |||
| pub mod mutex; | |||
| pub mod net; | |||
This comment has been minimized.
This comment has been minimized.
jackpot51
Nov 11, 2016
Author
Contributor
Because Redox does networking using files, and does not support the traditional Berkeley Socket API, we must specify an alternative net module, which is defined in sys::redox::net and imported down below
jackpot51
reviewed
Nov 11, 2016
| #[inline] | ||
| pub fn wait_timeout(&self, _mutex: &Mutex, _dur: Duration) -> bool { | ||
| ::sys_common::util::dumb_print(format_args!("condvar wait_timeout\n")); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
Nov 11, 2016
•
Author
Contributor
This will be implemented shortly with additional flags to futex
jackpot51
reviewed
Nov 11, 2016
|
|
||
| pub fn set_cloexec(&self) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("{}: set cloexec\n", self.fd)); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
reviewed
Nov 11, 2016
|
|
||
| pub fn set_nonblocking(&self, _nonblocking: bool) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("{}: set nonblocking\n", self.fd)); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
reviewed
Nov 11, 2016
|
|
||
| pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("Rename\n")); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
reviewed
Nov 11, 2016
|
|
||
| pub fn set_perm(_p: &Path, _perm: FilePermissions) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("Set perm\n")); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
reviewed
Nov 11, 2016
|
|
||
| pub fn symlink(_src: &Path, _dst: &Path) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("Symlink\n")); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nagisa
Nov 11, 2016
Contributor
In that case Err of some sort indicating that the operation is not supported should be returned (just like other OSes do when underlying filesystem does not support the operation).
jackpot51
reviewed
Nov 11, 2016
|
|
||
| pub fn link(_src: &Path, _dst: &Path) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("Link\n")); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
reviewed
Nov 11, 2016
| _p2: AnonPipe, | ||
| _v2: &mut Vec<u8>) -> io::Result<()> { | ||
| ::sys_common::util::dumb_print(format_args!("read2\n")); | ||
| unimplemented!(); |
This comment has been minimized.
This comment has been minimized.
jackpot51
Nov 11, 2016
Author
Contributor
Due to using set_nonblocking, which is not supported until fcntl is added, this is not implemented yet
jackpot51
reviewed
Nov 11, 2016
| @@ -28,7 +28,7 @@ | |||
| #![panic_runtime] | |||
| #![feature(panic_runtime)] | |||
| #![cfg_attr(unix, feature(libc))] | |||
| #![cfg_attr(windows, feature(core_intrinsics))] | |||
| #![cfg_attr(any(target_os = "redox", windows), feature(core_intrinsics))] | |||
This comment has been minimized.
This comment has been minimized.
jackpot51
Nov 11, 2016
•
Author
Contributor
Redox has no libc function for abort, so using the intrinsic is required
jackpot51
reviewed
Nov 11, 2016
| @@ -69,6 +69,7 @@ mod imp; | |||
|
|
|||
| // i686-pc-windows-gnu and all others | |||
| #[cfg(any(all(unix, not(target_os = "emscripten")), | |||
| target_os = "redox", | |||
This comment has been minimized.
This comment has been minimized.
jackpot51
Nov 11, 2016
Author
Contributor
Redox could potentially use libunwind for backtraces. Right now, panic_abort is preferred.
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton Take, for instance, terminal auto completion. With Prefix the way it is in this patch, the autocompleter can correctly fill in paths that start with Without this patch, filling in Since scheme-absolute paths are not often used in this manner, I would be ok with putting off the decision until later - but it will introduce potential problems in some applications |
This comment has been minimized.
This comment has been minimized.
|
Well, I suppose it was just an idea. If it's require to have a custom prefix for redox, I don't know how to solve that problem in a good way. |
This comment has been minimized.
This comment has been minimized.
|
I think we're at an impasse for now on the prefix issue. Can we just remove prefixes from this patch to get the bulk of the work landed and circle back to the tough design question? I'll go post a thread to irlo about expanding Prefix to raise awareness and see if anybody has bright ideas. |
This comment has been minimized.
This comment has been minimized.
|
@brson Sure |
This comment has been minimized.
This comment has been minimized.
|
@brson @alexcrichton The prefix handling has been removed. This must be readded in the future to avoid leaving in a potential security problem, but I would like to see a merge of Redox support before then as you have described. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ Thanks for your enduring patience. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Thanks @brson. I am going to work on adding the |
jackpot51
added some commits
Dec 12, 2016
This comment has been minimized.
This comment has been minimized.
|
@brson, this job failed due to an issue fixed by #38340. |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
jackpot51
force-pushed the
redox-os:redox
branch
from
cf87de9
to
3e15dc1
Dec 15, 2016
This comment has been minimized.
This comment has been minimized.
|
@bors r=brson |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
thanks @eddyb |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Dec 15, 2016
This comment has been minimized.
This comment has been minimized.
bors
merged commit 3e15dc1
into
rust-lang:master
Dec 15, 2016
This comment has been minimized.
This comment has been minimized.
|
woohoo! |
jackpot51
deleted the
redox-os:redox
branch
Dec 15, 2016
ids1024
referenced this pull request
Aug 18, 2017
Merged
Redox: correct is_absolute() and has_root() #43983
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this pull request
Aug 23, 2017
This comment has been minimized.
This comment has been minimized.
|
@jackpot51 |
This comment has been minimized.
This comment has been minimized.
|
You are probably right, it could be a noop... so long as a mutex is never recycled |
This comment has been minimized.
This comment has been minimized.
|
I don't think recycling is legal. POSIX docs say you must not initialize an already initialized mutex. |
This comment has been minimized.
This comment has been minimized.
|
Sounds like it could be a no-op then |
jackpot51 commentedNov 11, 2016
•
edited
Important - This is only a preview of a working
sys::redox.Compiling the Redox default distribution with this
libstdresults in a fully functioning distribution. As such, all further changes would be cosmetic or implementing features that have not been used by the default distribution (of which there are only a small number).I do not expect this to be merged, but would like to discuss how it may be improved and get feedback.
There are a few
unimplemented!()-cloexecfor example. I have documented them below. These would be resolved before desiring a merge.There are also issues with how the Redox syscall library is called - currently I am using a re-export in
libcbut that probably would not be desired.