-
Notifications
You must be signed in to change notification settings - Fork 822
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
Add support for WASI opening Unix special files #1566
Conversation
230a0fb78 Add test opening `/dev/null` on Unix git-subtree-dir: tests/wasi-wast git-subtree-split: 230a0fb78a0eb5252ab90cf2e7c064e3f0bfe2b1
…wasi-unix-special-files
Codecov Report
@@ Coverage Diff @@
## master #1566 +/- ##
==========================================
+ Coverage 31.46% 31.73% +0.26%
==========================================
Files 185 185
Lines 27294 27010 -284
==========================================
- Hits 8589 8572 -17
+ Misses 18705 18438 -267
Continue to review full report at Codecov.
|
(map_dirs "/dev:/dev") | ||
(assert_return (i64.const 0)) | ||
(assert_stdout "13\n") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline please!
(map_dirs "/dev:/dev") | ||
(assert_return (i64.const 0)) | ||
(assert_stdout "13\n") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are generated files, I can regenerate them all but it'd probably be best to do that separately
lib/wasi/src/state/mod.rs
Outdated
self.create_inode_with_stat(kind, is_preopened, name, stat) | ||
} | ||
|
||
/// creates an inode with the given filestat and insert it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// creates an inode with the given filestat and insert it. | |
/// Creates an inode with the given filestat and insert it. |
Rule of thumb is that either it's a sentence which starts with a capital and ends with a period (or question or exclamation mark) or it's a sentence fragment and has neither.
new_inode, | ||
); | ||
} else { | ||
unreachable!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment, I'm not sure whether this is reachable or not? If the place in the wasi-fs where the host path is being injected is controlled by the user then it seems like it should be a full Err? Otherwise, if this is part of mirroring the host paths then this is fine as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be reachable without unsafe I believe: it's not possible to put files in the virtual root right now, they have to come from a preopened directory and that directory will be mounted at /
.
Resolves #1565
Review