Wasmer: mapdir option not compatible with Wasmtime or Windows paths

Created on 30 Jun 2020  路  4Comments  路  Source: wasmerio/wasmer

Describe the bug

mapdir option, added back in #451 (cc @MarkMcCaskey) is described as compatible with Wasmtime, but uses a single : as a separator instead of :: for left and right sides.

Also, it doesn't account for possible colons in paths themselves, making this option impossible to use with absolute paths on Windows.

echo "`wasmer -V` | `rustc -V` | `uname -m`"

> echo "$(wasmer -V) | $(rustc -V)"
wasmer 0.17.0 | rustc 1.43.1 (8d69840ab 2020-05-04)

Steps to reproduce

With arbitrary temp.wasm try the following on a Windows machine:

$ wasmer run --mapdir=/tmp:C:\Users\rreverser\Desktop\wasi\tmp temp.wasm

Expected behavior

Wasm program is ran with /tmp mapped to C:\Users\rreverser\Desktop\wasi\tmp on the host machine.

Actual behavior

Getting an error in the console

Error: Directory mappings must consist of two paths separate by a colon. Found /tmp:C:\Users\rreverser\Desktop\wasi\tmp
resolved in wasmer refactor 馃悶 bug

All 4 comments

Also, it doesn't account for possible colons in paths themselves, making this option impossible to use with absolute paths on Windows.

That's a great point, we should probably allow separation by two colons :: @MarkMcCaskey

Note 1: it could be possible to also split the by the first encountered colon, to solve the issue in Windows.

Note 2: we are working on a new version of Wasmer and there might be a bit of delay on the resolution of the issue until we make it public. But we will work to make it happen! :)

We just fixed this on the refactor. Will close the issue once it's merged upstream.

We merged the refactor back into master a few weeks ago. Now the issue should be fixed in master.
Closing the issue!

Great, thanks!

Was this page helpful?
0 / 5 - 0 ratings