Stream: git-wasmtime

Topic: wasmtime / Issue #1655 Binfmt and argument passing


view this post on Zulip Wasmtime GitHub notifications bot (May 04 2020 at 21:20):

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?

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2020 at 00:03):

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: Oct 23 2024 at 20:03 UTC