-
Notifications
You must be signed in to change notification settings - Fork 824
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
test(wasi) Running all WASI tests with wasmer_vfs::mem_fs
too
#2546
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR updates how we generate the WASI test suites to test against the `wasmer_vfs::host_fs` (the default), and `wasmer_vfs::mem_fs` (that's new).
When opening a file with the `append` option turned on, all `seek` operations must be ignored. As described by [`open(2)`](https://man7.org/linux/man-pages/man2/open.2.html), the `O_APPEND` option describes this behavior well: > Before each write(2), the file offset is positioned at > the end of the file, as if with lseek(2). The > modification of the file offset and the write operation > are performed as a single atomic step. > > O_APPEND may lead to corrupted files on NFS filesystems > if more than one process appends data to a file at once. > This is because NFS does not support appending to a file, > so the client kernel has to simulate it, which can't be > done without a race condition. This patch implements that behavior. Also, this patch rewind the file cursor if opened in read-mode.
syrusakbary
approved these changes
Aug 31, 2021
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.
There are very few changes on mem_fs itself, which demonstrates the resilience of current implementation.
Great work on the PR!
bors try |
bors bot
added a commit
that referenced
this pull request
Sep 3, 2021
2550: feat(vfs) Update `Metadata.len` when updating the file buffer r=Hywan a=Hywan # Description This patch updates `wasmer_vfs::mem_fs` to handle `Metadata.len` correctly. The `len` value is updated when something is written in the file buffer. `len` is also updated when the file is truncated (with open options) or when the file is update with `set_len`. It helps to fix one test in #2546. Co-authored-by: Ivan Enderlin <[email protected]>
bors bot
added a commit
that referenced
this pull request
Sep 3, 2021
2551: feat(vfs) Add ability to rename a file with `mem_fs` r=Hywan a=Hywan # Description This patch updates `wasmer_vfs::mem_fs::FileSystem::rename` to handle file. Directories were handle previously, but not file. ~~Tests must be added though.~~ It solves the last bits of #2546. Co-authored-by: Ivan Enderlin <[email protected]>
bors r+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This WIP PR updates our WASI test framework to specifically test with
wasmer_vfs::host_fs
(the default, as of now) and withwasmer_vfs::mem_fs
(🆕!).Bug trophies:
Metadata.len
when updating the file buffer #2550mem_fs
#2551Review