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 the virtual_fs::StaticFile implementation #4355

Merged
merged 4 commits into from
Dec 14, 2023
Merged

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented Dec 14, 2023

The AsyncRead implementation for virtual_fs::StaticFile never updates its internal cursor, so reading from a StaticFile would always yield the same bytes without ever encountering an EOF.

I've fixed this by throwing away a lot of the custom code and just making StaticFile a thin wrapper around std::io::Cursor. I've also updated the other filesystem trait implementations so trying to modify a virtual_fs::StaticFile now returns a permission error instead of silently doing nothing.

Fixes wasmerio/wasmer-js#366

Michael-F-Bryan added 3 commits December 15, 2023 00:11
… cursor

fix: Trying to modify a `virtual_fs::StaticFile` now returns a permission error instead of silently doing nothing
…n use an `OwnedBuffer` while not breaking users of `StaticFile::new()`
lib/virtual-fs/src/static_file.rs Show resolved Hide resolved
@Michael-F-Bryan Michael-F-Bryan merged commit 88ac1b2 into master Dec 14, 2023
52 checks passed
@Michael-F-Bryan Michael-F-Bryan deleted the fix-static-file branch December 14, 2023 17:20
Michael-F-Bryan pushed a commit to wasmerio/wasmer-js that referenced this pull request Dec 15, 2023
…up-front-seems-to-always-read-the-same-bytes

Pick up wasmerio/wasmer#4355 to fix stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SDK-38] Providing stdin up front seems to always read the same bytes
2 participants