wasi-vfs icon indicating copy to clipboard operation
wasi-vfs copied to clipboard

Multiple calls to `pack`?

Open kesmit13 opened this issue 2 years ago • 3 comments

Is it possible to allow multiple calls to wasi-vfs pack? We'd like to add some files to a wasm module as a "standard library", but then add other directories later on with subsequent calls. It appears as though if you do that now, you only get the result of the final call.

kesmit13 avatar Feb 07 '23 17:02 kesmit13

I think you are mapping the same directory twice. See https://github.com/kateinoigakukun/wasi-vfs/tree/main/tests/run-make/pack-twice for the multiple call example.

kateinoigakukun avatar Feb 08 '23 02:02 kateinoigakukun

Hmm, I'm not having any luck with this. If I run the following, it works as expected:

# Add standard library modules
wasi-vfs pack udf-quickjs.wasm --mapdir "/app::./app" --mapdir "/lib::./lib" --output udf-quickjs.wasm

However, if I split it into two commands, I only get the first one:

# Add standard library modules
wasi-vfs pack udf-quickjs.wasm --mapdir "/lib::./lib" --output udf-quickjs.wasm

# Add customer code modules
wasi-vfs pack udf-quickjs.wasm --mapdir "/app::./app" --output udf-quickjs.wasm

kesmit13 avatar Feb 08 '23 15:02 kesmit13

Wait a second, things just got weird. If I reverse the order of the pack commands so that /app is first and /lib is second, it does work...

kesmit13 avatar Feb 08 '23 15:02 kesmit13