solo-io / proxy-runtime

Apache License 2.0
86 stars 25 forks source link

Support AssemblyScript 0.18.x+ #52

Closed Sodman closed 2 years ago

Sodman commented 3 years ago

Overview There was a breaking change with v0.18.0+ of AssemblyScript - https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.18.0 - This means a change in the exported runtime interface, which we'll need an update here in proxy-runtime to support.

To Reproduce: Setting the assemblyscript dependency in a filter using proxy-runtime to v0.18.x and then running a wasme build assemblyscript . -t test-filter:0.0.1 on it, we see the following error:

> asc assembly/index.ts -b build/untouched.wasm --use abort=abort_proc_exit -t build/untouched.wat --validate --sourceMap --debug

WARNING Unknown option '--validate'
ERROR TS6054: File '~lib/rt/index-full.ts' not found.

 } from "rt/index-full";
        ~~~~~~~~~~~~~~~
 in ~lib/@solo-io/proxy-runtime/malloc.ts(4,8)

FAILURE 1 parse error(s)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ asbuild:untouched: `asc assembly/index.ts -b build/untouched.wasm --use abort=abort_proc_exit -t build/untouched.wat --validate --sourceMap --debug`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ asbuild:untouched script.

Additional Context This error also occurs with the latest, which at the time of writing is v0.19.4

The last version which appears to work right now is 0.17.14.

Breaking release notes - https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.18.0

Migration note from the AssemblyScript Docs:

Migration from AssemblyScript 0.17 to 0.18 requires re-evaluating uses of retain and release, since these have been replaced with pin and unpin with slightly different semantics. An object can now be exactly pinned or not pinned, but cannot be pinned multiple times, and WebAssembly exports do not have a special case of pre-retaining objects for the caller anymore. Also, runtime names have changed, and instead of distinguishing between full (runtime exported) and half (runtime not exported), there's now an option --exportRuntime to achieve the effect with any runtime variant.

chandlernine commented 3 years ago

https://github.com/chandlernine/proxy-runtime/pull/1 has worked for me.

linzg2002 commented 3 years ago

hi @chandlernine, May I know when the new proxy-runtime version will be released to include the AS0.18+ support? Thanks.

kdorosh commented 2 years ago

resolved by https://github.com/solo-io/proxy-runtime/pull/61 , related testing https://github.com/solo-io/gloo/issues/5612#issuecomment-1030250985