Skip to content

Add os::fortanix_sgx::ffi module #57860

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 25, 2019
Merged

Conversation

jethrogb
Copy link
Contributor

This uses the same byte slice accessors that Unix has. The ABI specifies byte slices.

@rust-highfive
Copy link
Contributor

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 23, 2019
@jethrogb
Copy link
Contributor Author

r? @joshtriplett

@joshtriplett
Copy link
Member

Looks good to me. It'd be nice if we could share these implementations among all platforms that use bytes for OS strings, and I'd greatly appreciate a follow-up PR that unifies those implementations into a single internal module, but in the meantime...

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 23, 2019

📌 Commit 8db59d4 has been approved by joshtriplett

@bors
Copy link
Collaborator

bors commented Jan 23, 2019

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 23, 2019
@jethrogb
Copy link
Contributor Author

I did think about this, but it's not super trivial. I guess some of these files (e.g. os_str.rs) could live in sys_common. However, for ffi.rs, currently the documentation is slightly different for each platform (and I think it should be, because it's in a different module as exposed to the user):

  • SGX-specific extension to the primitives in the std::ffi module
  • Unix-specific extension to the primitives in the std::ffi module
  • Redox-specific extension to the primitives in the std::ffi module.

Also, the stability attributes might differ. So, while the code is the same, the metadata around it isn't, and I'm not sure how to unify this into a single place.

Centril added a commit to Centril/rust that referenced this pull request Jan 24, 2019
Add os::fortanix_sgx::ffi module

This uses the same byte slice accessors that Unix has. The [ABI specifies](https://docs.rs/fortanix-sgx-abi/0.3.2/fortanix_sgx_abi/struct.ByteBuffer.html) byte slices.
Centril added a commit to Centril/rust that referenced this pull request Jan 24, 2019
Add os::fortanix_sgx::ffi module

This uses the same byte slice accessors that Unix has. The [ABI specifies](https://docs.rs/fortanix-sgx-abi/0.3.2/fortanix_sgx_abi/struct.ByteBuffer.html) byte slices.
@joshtriplett
Copy link
Member

@jethrogb There could be one (internal) module for all platforms that use bytes, defining the extension traits, and then the various platform-specific modules could import and re-export the bits from those modules and provide their own top-level module documentation. The docs for the extension traits themselves don't need to vary by platform.

bors added a commit that referenced this pull request Jan 24, 2019
Rollup of 9 pull requests

Successful merges:

 - #57380 (Fix Instant/Duration math precision & associativity on Windows)
 - #57606 (Get rid of the fake stack frame for reading from constants)
 - #57803 (Several changes to libunwind for SGX target)
 - #57846 (rustdoc: fix ICE from loading proc-macro stubs)
 - #57860 (Add os::fortanix_sgx::ffi module)
 - #57861 (Don't export table by default in wasm)
 - #57863 (Add suggestion for incorrect field syntax.)
 - #57867 (Fix std::future::from_generator documentation)
 - #57873 (Stabilize no_panic_pow)

Failed merges:

r? @ghost
@bors bors merged commit 8db59d4 into rust-lang:master Jan 25, 2019
bors added a commit that referenced this pull request Mar 22, 2019
Unify OsString/OsStr for byte-based implementations

As requested in #57860

r? @joshtriplett
@workingjubilee workingjubilee added the O-SGX Target: SGX label Jul 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
O-SGX Target: SGX S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants