wagon icon indicating copy to clipboard operation
wagon copied to clipboard

wasm-run: could not read module: open env.wasm: no such file or directory

Open earth2378 opened this issue 6 years ago • 7 comments

I built wasm file using Emscripten. After I got wasm file and run wagon, it shows that

wasm-run: could not read module: open env.wasm: no such file or directory

How to fix it?

Thanks

earth2378 avatar Jul 04 '18 11:07 earth2378

hi @earth2378,

thanks for the report. could you please give a very simple reproducer? (ie: minimal instructions so we can tackle this?)

thanks a lot.

sbinet avatar Jul 04 '18 14:07 sbinet

I'm not sure how this error was generated, but, for what it's worth, I've found that all programs compiled by emscripten require various things to be exported by the "environment". Emscripten generally produces both a wasm module and a js loader file which provides those exports. I've been able to hack wagon to provide things sufficient for simple programs. I'd like to put together a PR for this when I get back from vacation - if there's interest. Unfortunately it is my impression that the "environment" part is not yet well standardized for wasm.

On Wed, Jul 4, 2018, 5:14 PM Sebastien Binet [email protected] wrote:

hi @earth2378 https://github.com/earth2378,

thanks for the report. could you please give a very simple reproducer? (ie: minimal instructions so we can tackle this?)

thanks a lot.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/go-interpreter/wagon/issues/64#issuecomment-402491555, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXBcfnBVocWPj-oP-Vb0dtj3aAqp_mEks5uDM3DgaJpZM4VCZrn .

andreimatei avatar Jul 04 '18 16:07 andreimatei

@andreimatei definitely an interest :) (enjoy your holidays!)

sbinet avatar Jul 04 '18 17:07 sbinet

same problem here, any sort of hello world that I might compile, ends up with wast/wasm that calls (import "env" ... ) or (import "stdlib" ...) and wasm-run dies with could not find stdlib.wasm, etc. I'm not sure how to provide these libraries to wasm-run.

donpdonp avatar Nov 14 '18 19:11 donpdonp

@donpdonp and did you get a solution?

hunjixin avatar Mar 25 '19 03:03 hunjixin

Can anyone provide an ongoing solution?

guo-li-hua avatar Jan 10 '20 09:01 guo-li-hua

@guo-li-hua some simply code can work while specify high level opt flag while generate,but if you use something like memory op etc,still error. i recommans to use rust ,very compatible for wasm running

hunjixin avatar Jan 10 '20 15:01 hunjixin