wasi-vfs
wasi-vfs copied to clipboard
Multiple calls to `pack`?
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.
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.
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
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...