-
Notifications
You must be signed in to change notification settings - Fork 45
MemoryFS::new()
panics in webassembly
#68
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
Comments
Hi, interesting use case 👍 Do you have a stack trace for the panic? That might help diagnose the issue. As of yet, webassembly is not supported as a target. It might be difficult to do, due to the constraints of the platform. But if it can be done with reasonable effort, I think it is worth considering. I just gave it a quick try with
Running the resulting binary with
Seems to run ok
Running the whole test suite panics when it tries to get the temp directory in the physical fs tests. It looks like that is not supported in wasm. |
Here's the experimental branch with some required version updates to allow compilation: |
Hi @manuel-woelker. I came across a similar issue when using I believe it's caused by a dependency on |
Hi @piotr-roslaniec , thanks for the test case! I am wondering if there are "platform differences" when running via wasmtime compared to wasm-pack. My last test with wasmtime seemed to be fine with the The issue with the InMemoryFs seems to be caused in Since this timestamp is kinda bogus anyway, a workaround might be to set it to a constant timestamp instead. This might even improve determinism. I am still not sure on the best course of action regarding #![no_std] support. |
Tried to reproduce locally, unfortunately the test fails to run. I'll try to find a workaround later. |
Hi @manuel-woelker, thank you for looking into this. I've added a Node.js test, it should make things easier to reproduce: piotr-roslaniec/rust-vfs-wasm32-unknown-unknown@598c98a#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R14 I also found this drop-in replacement for |
I just came across this issue as well. Here were my patches necessary to get the crate to work in WASM: master...landaire:rust-vfs:fix/wasm Summary of changes:
Otherwise things are working great. |
Uh oh!
There was an error while loading. Please reload this page.
Hi. I was hoping to use vfs as an abstraction so that a lib designed for use with std::fs (that really just uses the filesystem for simple input) could be used from webassembly. I went through and adjusted everything to go through vfs instead, but then in the webassembly build I got a panic on
MemoryFS::new()
😭.Any idea why this would be and if it could be fixed?
The text was updated successfully, but these errors were encountered: