oksoft-git opened Issue #1655:
I registered wasmtime to binfmt by adding config file to /etc/binfmt.d
/etc/binfmt.d/wasmtime.conf
:wasm32-wasi:M::\x00asm:\xff\xff\xff\xff:/usr/local/bin/wasmtime:
But i can see there are some problems, for example with passing arguments.
For example
./app.wasm --help
opens Wasmtime's help, not the command ones.But
./app.wasm -- --help
works fine.I did an workaround:
#!/bin/bash /usr/local/lib/wasmtime $1 -- ${*:2}
but it isn't an elegant solution.
Some possibility to create an official binfmt?
sunfishcode commented on Issue #1655:
One of the things that make this tricky is that Wasmtime currently needs --dir and/or --mapdir flags to pass in pre-opened directories to allow the program to access files. So even if we had a binfmt entry which added
--
, it wouldn't handle directory permissions unless we set up preconfigured directories to grant, but that's even less elegant, and goes against the spirit of WASI. We have plans to make the command-line easier to use which will address this, and then we'll be able to address the--
issue at the same time.
Last updated: Nov 22 2024 at 16:03 UTC