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

wasi: Use shared API for preopened fds #59727

Merged
merged 1 commit into from Apr 6, 2019

Conversation

Projects
None yet
6 participants
@alexcrichton
Copy link
Member

commented Apr 5, 2019

This commit updates the wasi target with supported added in
CraneStation/wasi-sysroot#10. That function allows both C and Rust to
cooperate in how preopened files are managed, enabling us to learn about
propened files through the same interface. The open_parent function in
the wasi fs module was updated to avoid its own initialization of a
global preopened map and instead delegate to libc to perform this
functionality.

This should both be more robust into the future in terms of handling
path logic as well as ensuring the propened map is correctly set up at
process boot time. This does currently require some unfortunate
allocations on our side, but if that becomes an issue we can always
paper over those in time!

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 5, 2019

r? @aidanhs

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

@alexcrichton alexcrichton force-pushed the alexcrichton:wasi-apis branch from 0c1a452 to 26a8a23 Apr 5, 2019

wasi: Use shared API for preopened fds
This commit updates the wasi target with supported added in
CraneStation/wasi-sysroot#10. That function allows both C and Rust to
cooperate in how preopened files are managed, enabling us to learn about
propened files through the same interface. The `open_parent` function in
the wasi `fs` module was updated to avoid its own initialization of a
global preopened map and instead delegate to libc to perform this
functionality.

This should both be more robust into the future in terms of handling
path logic as well as ensuring the propened map is correctly set up at
process boot time. This does currently require some unfortunate
allocations on our side, but if that becomes an issue we can always
paper over those in time!

@alexcrichton alexcrichton force-pushed the alexcrichton:wasi-apis branch from 26a8a23 to bb2c0d1 Apr 5, 2019

@alexcrichton

This comment has been minimized.

Copy link
Member Author

commented Apr 5, 2019

@Centril

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2019

@alexcrichton Can't you just give @fitzgen r+ rights and make highfive listen? :P

@fitzgen

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 5, 2019

📌 Commit bb2c0d1 has been approved by fitzgen

Centril added a commit to Centril/rust that referenced this pull request Apr 5, 2019

Rollup merge of rust-lang#59727 - alexcrichton:wasi-apis, r=fitzgen
wasi: Use shared API for preopened fds

This commit updates the wasi target with supported added in
CraneStation/wasi-sysroot#10. That function allows both C and Rust to
cooperate in how preopened files are managed, enabling us to learn about
propened files through the same interface. The `open_parent` function in
the wasi `fs` module was updated to avoid its own initialization of a
global preopened map and instead delegate to libc to perform this
functionality.

This should both be more robust into the future in terms of handling
path logic as well as ensuring the propened map is correctly set up at
process boot time. This does currently require some unfortunate
allocations on our side, but if that becomes an issue we can always
paper over those in time!

@Centril Centril referenced this pull request Apr 5, 2019

Closed

Rollup of 6 pull requests #59736

bors added a commit that referenced this pull request Apr 5, 2019

Auto merge of #59736 - Centril:rollup-lht0sm9, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59119 (Future-proof the Futures API)
 - #59599 (Updated RELEASES.md for 1.34.0)
 - #59624 (SGX target: Use linker option to avoid code CGU assignment kludge)
 - #59696 (Remove invalid assertion back:🔗:from add_upstream_rust_crates().)
 - #59707 (Add missing tryfrom example)
 - #59727 (wasi: Use shared API for preopened fds)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Apr 5, 2019

Rollup merge of rust-lang#59727 - alexcrichton:wasi-apis, r=fitzgen
wasi: Use shared API for preopened fds

This commit updates the wasi target with supported added in
CraneStation/wasi-sysroot#10. That function allows both C and Rust to
cooperate in how preopened files are managed, enabling us to learn about
propened files through the same interface. The `open_parent` function in
the wasi `fs` module was updated to avoid its own initialization of a
global preopened map and instead delegate to libc to perform this
functionality.

This should both be more robust into the future in terms of handling
path logic as well as ensuring the propened map is correctly set up at
process boot time. This does currently require some unfortunate
allocations on our side, but if that becomes an issue we can always
paper over those in time!

@Centril Centril referenced this pull request Apr 5, 2019

Merged

Rollup of 6 pull requests #59741

bors added a commit that referenced this pull request Apr 5, 2019

Auto merge of #59741 - Centril:rollup-3us4b8q, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #58894 (Fix invalid bounds string generation in rustdoc)
 - #59599 (Updated RELEASES.md for 1.34.0)
 - #59624 (SGX target: Use linker option to avoid code CGU assignment kludge)
 - #59696 (Remove invalid assertion back:🔗:from add_upstream_rust_crates().)
 - #59707 (Add missing tryfrom example)
 - #59727 (wasi: Use shared API for preopened fds)

Failed merges:

r? @ghost

@bors bors merged commit bb2c0d1 into rust-lang:master Apr 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.