Skip to content

Fix file writes in preview 2 implementation#7394

Merged
alexcrichton merged 2 commits into
mainfrom
pch/preview2_large_writes
Oct 31, 2023
Merged

Fix file writes in preview 2 implementation#7394
alexcrichton merged 2 commits into
mainfrom
pch/preview2_large_writes

Conversation

@pchickey
Copy link
Copy Markdown
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
Copy Markdown
Member

Should this be backported to 14.0.x as well?

@pchickey
Copy link
Copy Markdown
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 alexcrichton and fitzgen 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
@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