Contribution towards Emscripten + Wasi #2623
Replies: 5 comments
-
Hello, Thanks for the question. Does your opencv project have been compiled to Wasm with Emscripten only? |
Beta Was this translation helpful? Give feedback.
-
Its not mine, I just pulled the wasm file out from here It is definitely Emscripten as the main ABI, but it has a whole page of |
Beta Was this translation helpful? Give feedback.
-
Well OK, I'm sorry but it's not on our agenda to support both ABI for the moment. As far as I know, it's rather unusual to get two of them at the same time (it's likely that I'm wrong here!). Contributions are welcomed as it was your first question! I suppose it's doable, as we use the same |
Beta Was this translation helpful? Give feedback.
-
Okay thanks! I'll look for Mark's reply and if there's no obvious reason why it would fail I'll slowly move along on this feature. Maybe there's a more simple way to do it like you're describing (I'm not sure how to combine import objects). I've just duplicated the Emscripten folder, and been merging the WASI folder files/code into it. It's been pretty straightforward, the only thing they have conflicting definitions of is WasmPtr, and just renaming to "WasiWasmPtr" will hopefully resolve that. There's some semi-complicated module import issues I'm working on, but that's more of a Rust issue/complication. I agree I don't know why the API's are mixed together, but that link in the first post to the dedicated error message for this situation I guess suggests it's somewhat common. |
Beta Was this translation helpful? Give feedback.
-
Not really: #1977 (comment) (Just linking this to organize related issues. I suspect you already know.) |
Beta Was this translation helpful? Give feedback.
-
Summary
Is it practical for a outsider/non-major-contributor to implement the emscripten + wasi environment (relevent code snippet here)?
Additional details
Current plan is to combine this wasi env with the equivlent emscripten env and just rename them to match the
___wasi_
namingI only need it for a specific usecase, not a stable feature. Someone compiled opencv to wasm and I just want to get that working at an alpha version in Rust. I know some about implementing wasm imports in JS, which wasnt too difficult, but I don't know much about the internal structure of the wasmer crate or the wasmer runtime.
Beta Was this translation helpful? Give feedback.
All reactions