lunatic icon indicating copy to clipboard operation
lunatic copied to clipboard

Native plugins support

Open tqwewe opened this issue 3 years ago • 2 comments

Adds support for native plugins (.dll/.so/.dylib) which can be loaded with the --plugins flag.

An example exists in the examples/ directory, along with some docs on running the example.

Related to https://github.com/lunatic-solutions/lunatic/issues/69 (nice)

tqwewe avatar Nov 15 '22 07:11 tqwewe

I just came across an issue, and I'm not sure whats going on.

Screen Shot 2022-11-17 at 12 05 15 pm

When I run lunatic in release, everything works fine... but running lunatic in debug mode causes the host functions to silently fail 🤔

It seems like if I compile the wasm plugin and module to debug mode, and run lunatic in debug mode, it works then. So I cannot run lunatic with a wasm module that doesn't match the release/debug target.

tqwewe avatar Nov 17 '22 04:11 tqwewe

Sorry, it took me a bit longer to get around and check this out. Great work so far!

I also can't figure out what the issue with release/debug builds could be. From my understanding on how dynamic loading works, it shouldn't be an issue. It might be something Wasmtime specific, because they do some assembly magic to allow stack switching? Maybe creating a minimal reproducible example with just wasmtime and dynamic loading could help us to pinpoint it.

bkolobara avatar Dec 01 '22 09:12 bkolobara