When calling wasmlink -n opa caller.wasm policy.wasm, and policy.wasm contains both a function named opa_eval and a function named eval, the latter is prefixed with opa in AddPrefixToName can causes a clash when trying to render the combined module:
policy.wasm:000018a: error: redefinition of function "$opa_eval"
However, the workaround is to rename the module, and avoid that. So instead, if we do wasmlink -n policy caller.wasm policy.wasm -o out.wasm and import stuff from policy instead of from opa, the combining succeeds.
When calling
wasmlink -n opa caller.wasm policy.wasm, andpolicy.wasmcontains both a function namedopa_evaland a function namedeval, the latter is prefixed withopain AddPrefixToName can causes a clash when trying to render the combined module:However, the workaround is to rename the module, and avoid that. So instead, if we do
wasmlink -n policy caller.wasm policy.wasm -o out.wasmand import stuff frompolicyinstead of fromopa, the combining succeeds.