vmware-labs / webassembly-language-runtimes

Wasm Language Runtimes provides popular language runtimes (Ruby, Python, …) precompiled to WebAssembly that are tested for compatibility and kept up to date when new versions of upstream languages are released
Apache License 2.0
326 stars 27 forks source link

error: unexpected argument '--mapdir' found #132

Closed danielwcho closed 1 month ago

danielwcho commented 1 month ago

Describe the bug

when I try to run the code in the picture, I get

error: unexpected argument '--mapdir' found

  tip: to pass '--mapdir' as a value, use '-- --mapdir'

Usage: wasmtime run [OPTIONS] <WASM>...

Reproduction steps

  1. Checked my wasmtime version (wasmtime-cli 22.0.0 (761f044ef 2024-06-20)
  2. I am pretty sure every files are in the correct directory

Expected behavior

The 🐇 woke up with a smile. The 🌅 was shining on his face. A 🥕 was waiting for him on the table. He will put on his 👖 and get out of the 🏠 for a walk.

Additional context

Screenshot 2024-07-08 at 5 40 45 PM
betaboon commented 1 month ago

i just stumbled upon the same issue.

it seems like a while ago wasmtime redesigned their cli interface

--mapdir GUEST_DIR::HOST_DIR has been replaced by --dir HOST_DIR::GUEST_DIR.

so in your case, instead of

wasmtime run \
  --mapdir /workdir::$PWD/workdir \
  --mapdir /::$PWD/tmp/unpacked \
  tmp/unpacked/bin/python-3.12.0.wasm

this should do the trick:

wasmtime run \
  --dir $PWD/workdir::/workdir \
  --dir $PWD/tmp/unpacked::/ \
  tmp/unpacked/bin/python-3.12.0.wasm
danielwcho commented 1 month ago

Thanks!