Trying to retrofit an existing wasm module with a wasi interface, I've stumbled upon this:
1: command export 'opa_wasm_abi_version' is not a function
and indeed, that's a global _variable_ -- I was wondering why that must raise an error? I'd have thought they could just be ignored.
The general idea is that command modules should only be exporting functions (and a few other "well-known" items); if you pass --allow-unknown-exports
it'll bypass that check
Or Linker::allow_unknown_exports
if you're writing a host
I see, thanks! Is that part of the wasi spec, or something that's wasmtime-specific?
It had started to be part of the WASI spec, but that part of WASI is being moved into the component-model spec.
The underlying reason is that in a command-style program, you call the program once, it does its thing, and then exits, so there shouldn't be any other function exports.
@Dan Gohman @Peter Huene thanks (again)
Stephan Renatus has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC