proxy-wasm-cpp-host icon indicating copy to clipboard operation
proxy-wasm-cpp-host copied to clipboard

add all wasi hostcalls used by Go SDK

Open johnlanni opened this issue 8 months ago • 8 comments

In #427, a portion of the wasi hostcalls was added, but not all. Now, all the wasi hostcalls have been included, and their stability has been verified in our multiple go 1.24 compiled wasm plugins

johnlanni avatar May 09 '25 08:05 johnlanni

cc @leonm1 @PiotrSikora

johnlanni avatar May 09 '25 08:05 johnlanni

Thank you for sending this PR! I will take a look at the code a bit later today, but I was wondering if any of the wasm plugins importing these host calls are public so I can take a look.

I'd be interested to see what logic causes the inclusion of them.

leonm1 avatar May 09 '25 10:05 leonm1

Thank you for sending this PR! I will take a look at the code a bit later today, but I was wondering if any of the wasm plugins importing these host calls are public so I can take a look.

I'd be interested to see what logic causes the inclusion of them.

Sorry for the late reply. Here are some examples of plugin code that has additional WASI dependencies. I've been encountering new WASI dependencies with different plugins, so I included all of them: https://github.com/alibaba/higress/tree/main/plugins/wasm-go/mcp-servers/all-in-one https://github.com/alibaba/higress/tree/main/plugins/wasm-go/extensions/ext-auth

Convert to wat and see the dependencies on some previously unsupported wasi: image

johnlanni avatar May 19 '25 02:05 johnlanni

@leonm1 There are two more important changes:

  1. Allow calling poll_oneoff during malloc, because Go calls sleep during GC
  2. The implementation of poll_oneoff has been changed to no-op instead of error, as the previous implementation would cause a panic during GC

johnlanni avatar May 19 '25 02:05 johnlanni

In my example use cases here - https://github.com/shukitchan/ats-wasm-ai-inference/ I find that I need this PR. Otherwise, I am getting the same error as in #308

shukitchan avatar Sep 23 '25 00:09 shukitchan

Thanks for the updates @johnlanni ! It looks like the current presubmit check failures are due to the Github action runners exhausting their allocated disk space. I am looking into obtaining more storage for those.

mpwarres avatar Sep 25 '25 16:09 mpwarres

I have fixed the tests, please help approve the workflow @mpwarres @leonm1

johnlanni avatar Oct 23 '25 01:10 johnlanni

Please review again, thank you @PiotrSikora @martijneken

johnlanni avatar Oct 27 '25 07:10 johnlanni