-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Implement libstd for CloudABI. #47268
Merged
Merged
Commits on Jan 11, 2018
-
Import the CloudABI system call bindings into the libstd tree.
These automatically generated Rust source files allow us to invoke system calls within CloudABI processes. These will be used by libstd to implement primitives for I/O, threading, etc. These source files are normally part of the 'cloudabi' crate. In the case of libstd, we'd better copy them into the source tree, as having external dependencies in libstd is a bit messy. Original source files can be found here: https://github.com/NuxiNL/cloudabi/tree/master/rust
Configuration menu - View commit details
-
Copy full SHA for 795e173 - Browse repository at this point
Copy the full SHA 795e173View commit details -
Implement libstd for CloudABI.
Though CloudABI is strongly inspired by POSIX, its absence of features that don't work well with capability-based sandboxing makes it different enough that adding bits to sys/unix will make things a mess. This change therefore adds CloudABI specific platform code under sys/cloudabi and borrows parts from sys/unix that can be used without changes. One of the goals of this implementation is to build as much as possible directly on top of CloudABI's system call layer, as opposed to using the C library. This is preferred, as the system call layer is supposed to be stable, whereas the C library ABI technically is not. An advantage of this approach is that it allows us to implement certain interfaces, such as mutexes and condition variables more optimally. They can be lighter than the ones provided by pthreads. This change disables some modules that cannot realistically be implemented right now. For example, libstd's pathname abstraction is not designed with POSIX *at() (e.g., openat()) in mind. The *at() functions are the only set of file system APIs available on CloudABI. There is no global file system namespace, nor a process working directory. Discussions on how to port these modules over are outside the scope of this change. Apart from this change, there are still some other minor fixups that need to be made to platform independent code to make things build. These will be sent out separately, so they can be reviewed more thoroughly.
1Configuration menu - View commit details
-
Copy full SHA for 2074526 - Browse repository at this point
Copy the full SHA 2074526View commit details -
Add shims for modules that we can't implement on CloudABI.
As discussed in rust-lang#47268, libstd isn't ready to have certain functionality disabled yet. Follow wasm's approach of adding no-op modules for all of the features that we can't implement. I've placed all of those shims in a shims/ subdirectory, so we (the CloudABI folks) can experiment with removing them more easily. It also ensures that the code that does work doesn't get polluted with lots of useless boilerplate code.
Configuration menu - View commit details
-
Copy full SHA for d882bb5 - Browse repository at this point
Copy the full SHA d882bb5View commit details -
There are some tests that need to be disabled on CloudABI specifically, due to the fact that the shims cannot be built in combination with unix::ext or windows::ext. Also improve the scoping of some imports to suppress compiler warnings.
Configuration menu - View commit details
-
Copy full SHA for d9d97c9 - Browse repository at this point
Copy the full SHA d9d97c9View commit details -
Make the documentation build work on CloudABI.
Just like with wasm, we can't just import unix::ext and windows::ext. Our shims are not complete enough for that.
Configuration menu - View commit details
-
Copy full SHA for cc8565b - Browse repository at this point
Copy the full SHA cc8565bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a8d55a - Browse repository at this point
Copy the full SHA 6a8d55aView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.