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

Fix file writes in preview 2 implementation #7394

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

pchickey
Copy link
Contributor

@pchickey pchickey commented Oct 27, 2023

In #7130, there was a regression introduced in FileOutputStream where the position cursor was not updated after each write. This affects all file writes except for when the file is opened for appending.

This PR also adds a test which performs a larger (64k) write to a file than any prior tests.

Fixes #7390

@github-actions github-actions bot added the wasi Issues pertaining to WASI label Oct 28, 2023
@pchickey pchickey force-pushed the pch/preview2_large_writes branch from adf9592 to 1fd1585 Compare October 31, 2023 01:11
@alexcrichton
Copy link
Member

Should this be backported to 14.0.x as well?

@pchickey
Copy link
Contributor Author

Yes. I was going to write more tests and I was chasing down some other potential improvements as well, but the bug here is obvious now, so I think we should just land this patch in main and in the next 14 release to go out.

@pchickey pchickey changed the title Fix large file writes under preview 2 implementation Fix file writes under preview 2 implementation Oct 31, 2023
@pchickey pchickey changed the title Fix file writes under preview 2 implementation Fix file writes in preview 2 implementation Oct 31, 2023
@pchickey pchickey marked this pull request as ready for review October 31, 2023 16:18
@pchickey pchickey requested a review from a team as a code owner October 31, 2023 16:18
@pchickey pchickey requested review from fitzgen and alexcrichton and removed request for a team and fitzgen October 31, 2023 16:18
@alexcrichton alexcrichton added this pull request to the merge queue Oct 31, 2023
Merged via the queue into main with commit 020625a Oct 31, 2023
40 checks passed
@alexcrichton alexcrichton deleted the pch/preview2_large_writes branch October 31, 2023 17:10
alexcrichton pushed a commit to alexcrichton/wasmtime that referenced this pull request Oct 31, 2023
* add a preview1_file_write test to show behavior of large file writes

reproduces bytecodealliance#7390

* filesystem output-stream: update position cursor
alexcrichton added a commit that referenced this pull request Oct 31, 2023
* add a preview1_file_write test to show behavior of large file writes

reproduces #7390

* filesystem output-stream: update position cursor

Co-authored-by: Pat Hickey <phickey@fastly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasi Issues pertaining to WASI
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

file truncation with preview2 adapter?
2 participants