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

[Wip]Tentative add alloc::io module. #77922

Closed
wants to merge 9 commits into from
Closed

Conversation

lygstate
Copy link
Contributor

@lygstate lygstate commented Oct 13, 2020

At the current stage, just copy std::io into alloca::io and

  • Remove the os related things such as std::io::stdio.
  • Also convert all Error to string
  • Add core:ctypes
  • Use core::ctypes::iovec instead.

Get std::io to be an core::io component so that can be used by runtime implemenation.

Especially for posix libc implemenation in rust with

  • syscall(Linux)
  • win32 api (windows)
  • syscall(osx)
  • syscall(redox)
  • ? (fedora)
    and so on.

This is for https://github.com/redox-os/relibc

Also for
https://github.com/rulibc/rulibc
The fork of relibc that act as an msvcrt/mingw/cygwin/msys2 alternative on win32

glibc/musl alternative on linux world.

redox support will alomost unchanged with the upstream Thttps://github.com/redox-os/relibc

And makes platform dependent IoSliceMut can be customized by the user
And give the default impl for windows/posix.

#36193
related

Depends on
rust-lang/project-error-handling#3
#77384

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2020
@lygstate lygstate force-pushed the rulibc branch 2 times, most recently from 81aa91d to 5a33b12 Compare October 13, 2020 22:13
@jyn514
Copy link
Member

jyn514 commented Oct 13, 2020

This looks like a copy/paste of std::io to alloc::io. Unfortunately, this won't work because alloc is meant to work on platforms without an operating system and io depends on the operating system.

I recommend going through an RFC process or https://internals.rust-lang.org/ if you're interested in this change, but it will need a lot of design and a rationale for why it's useful. This PR as-is is unlikely to be merged.

@lygstate
Copy link
Contributor Author

This looks like a copy/paste of std::io to alloc::io. Unfortunately, this won't work because alloc is meant to work on platforms without an operating system and io depends on the operating system.

I recommend going through an RFC process or https://internals.rust-lang.org/ if you're interested in this change, but it will need a lot of design and a rationale for why it's useful. This PR as-is is unlikely to be merged.

Thanks, this tentative, I have already removed the operating system part from alloc::io, I placed it under io because std::io depends on alloc, so I didn't place it under core::io.
The only part of alloc::io that are special are the iovec struct and I place it in the core::ctypes, it's seems other than windows platform, all other platform are the same, never mind what iovec it is, it's just a structure need to passed into operating system, so we just need to compatiable with the corresponding operating system

@lygstate lygstate changed the title Tentative add alloc::io module. [Wip]Tentative add alloc::io module. Oct 14, 2020
@bors
Copy link
Contributor

bors commented Oct 18, 2020

☔ The latest upstream changes (presumably #76885) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@crlf0710 crlf0710 marked this pull request as draft November 6, 2020 16:10
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Caused by:
  failed to open: /checkout/src/bootstrap/Cargo.lock

Caused by:
  Read-only file system (os error 30)
Build completed unsuccessfully in 0:00:37

@bors
Copy link
Contributor

bors commented Feb 18, 2021

☔ The latest upstream changes (presumably #82249) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 11, 2021
@Dylan-DPC-zz
Copy link

@lygstate can you resolve the conflicts?

@lygstate
Copy link
Contributor Author

@Dylan-DPC Currently it's depends on #77384
after that merged, then this can be working on

@workingjubilee workingjubilee added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Apr 25, 2021
@Dylan-DPC-zz
Copy link

closing this as this depends on a draft, which is going to take some time to get merged and it would probably be easier to open a fresh pr instead of solving all the conflicts that will accumulate by then.

@Dylan-DPC-zz Dylan-DPC-zz added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. labels Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Blocked on something else such as an RFC or other implementation work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants