wasmtime-wiggle: make it possible to add host funcs to a config under an alias - #2761
Conversation
Subscribe to Label Actioncc @kubkon DetailsThis issue or pull request has been labeled: "wasi"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
alexcrichton
left a comment
There was a problem hiding this comment.
Would this be something we could perhaps configure at the wiggle-macro-invocation level? It seems like this would add a lot of functions that are rarely used, which isn't necessarily a bad thing just wondering if we could move this to compile time instead of runtime.
|
Yeah, we could do this at compile time instead of at run-time. This does add a lot of API surface but effectively its just out-lining the functionality that is already there for I'd like to defer adding compile-time config for this for a little bit. It is an optimization, but for code should get called once per engine creation. I expect plenty more structural changes to wiggle coming down the pipe as witx and friends evolve, so I don't want to add more complexity to the macro right now if we don't have to. |
|
Ok sounds reasonable! |
This addition to wasmtime-wiggle makes it possible to add a function to a
Configunder an arbitrary name.Embeddings that allow Wasm functions defined by wiggle to be imported under additional names (for example, for legacy compatibility) can do so by writing their own
Linkerinvocation, but functions were added to aConfigunder only the name specified by the witx file. Now, in addition to the defaultadd_to_configbehavior, you canadd_<functionname>_to_config(&mut config, module: &str, field: &str)as well.