Stream: git-wasmtime

Topic: wasmtime / issue #5675 `Linker::instantiate_pre` could av...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 20:13):

abrown opened issue #5675:

In #5484, it would have been ideal to check if an instance was "instantiatable" by a Linker much sooner than when we currently check it (at startup instead of when a thread is spawned). Because a Store is not available until the thread is spawned and Linker::instantiate_pre requires a mutable Store, we cannot do this check sooner. If Linker::instantiate_pre were refactored to be called without a Store or if some other method were available to "check that all the imports can be satisfied," then the check in wasi-threads could be moved up and this issue closed.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 21:52):

jameysharp commented on issue #5675:

I was just looking at a wasmtime embedder that constructs an otherwise-unused Store solely for use with instantiate_pre. I agree that it'd be nice to not have to do that!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 23:16):

pchickey commented on issue #5675:

This isn't a very helpful answer, but I wanted this as well when we introduced instantiate_pre, and there was some complexity of the implementation that made it extremely difficult, so I gave up.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2023 at 23:16):

pchickey edited a comment on issue #5675:

This isn't a very helpful answer, but I wanted this as well when we introduced instantiate_pre, and there was some complexity of the implementation that made it extremely difficult, so I gave up. The situation may have changed and I'd welcome if someone was able to do it!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2023 at 16:32):

alexcrichton commented on issue #5675:

I was struck with inspiration when thinking about this again and created https://github.com/bytecodealliance/wasmtime/pull/5683

view this post on Zulip Wasmtime GitHub notifications bot (Feb 02 2023 at 17:54):

alexcrichton closed issue #5675:

In #5484, it would have been ideal to check if an instance was "instantiatable" by a Linker much sooner than when we currently check it (at startup instead of when a thread is spawned). Because a Store is not available until the thread is spawned and Linker::instantiate_pre requires a mutable Store, we cannot do this check sooner. If Linker::instantiate_pre were refactored to be called without a Store or if some other method were available to "check that all the imports can be satisfied," then the check in wasi-threads could be moved up and this issue closed.


Last updated: Nov 22 2024 at 16:03 UTC