alexcrichton opened issue #3388:
For this program:
use wasmtime::*; fn main() { let mut config = Config::new(); config.wasm_module_linking(true); let engine = Engine::new(&config).unwrap(); let module = Module::new( &engine, r#" (module (import "foo" "bar" (func)) ) "#, ) .unwrap(); let mut linker = Linker::new(&engine); linker.func_wrap("foo", "baz", || {}).unwrap(); let mut store = Store::new(&engine, ()); println!("{:?}", linker.instantiate(&mut store, &module).unwrap_err()); }
it generates this error message:
unknown import: `foo` has not been defined
whereas if module linking is disabled it generates:
unknown import: `foo::bar` has not been defined
The latter error message here is much better than the former. The reason for this is how Wasmtime reinterprets two-level imports as single-level-imports-of-instances, but the error message generation doesn't do a great job of taking this into account.
alexcrichton labeled issue #3388:
For this program:
use wasmtime::*; fn main() { let mut config = Config::new(); config.wasm_module_linking(true); let engine = Engine::new(&config).unwrap(); let module = Module::new( &engine, r#" (module (import "foo" "bar" (func)) ) "#, ) .unwrap(); let mut linker = Linker::new(&engine); linker.func_wrap("foo", "baz", || {}).unwrap(); let mut store = Store::new(&engine, ()); println!("{:?}", linker.instantiate(&mut store, &module).unwrap_err()); }
it generates this error message:
unknown import: `foo` has not been defined
whereas if module linking is disabled it generates:
unknown import: `foo::bar` has not been defined
The latter error message here is much better than the former. The reason for this is how Wasmtime reinterprets two-level imports as single-level-imports-of-instances, but the error message generation doesn't do a great job of taking this into account.
github-actions[bot] commented on issue #3388:
Subscribe to Label Action
cc @peterhuene
<details>
This issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
- peterhuene: wasmtime:api
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
alexcrichton commented on issue #3388:
Fixed in https://github.com/bytecodealliance/wasmtime/pull/3456
alexcrichton closed issue #3388:
For this program:
use wasmtime::*; fn main() { let mut config = Config::new(); config.wasm_module_linking(true); let engine = Engine::new(&config).unwrap(); let module = Module::new( &engine, r#" (module (import "foo" "bar" (func)) ) "#, ) .unwrap(); let mut linker = Linker::new(&engine); linker.func_wrap("foo", "baz", || {}).unwrap(); let mut store = Store::new(&engine, ()); println!("{:?}", linker.instantiate(&mut store, &module).unwrap_err()); }
it generates this error message:
unknown import: `foo` has not been defined
whereas if module linking is disabled it generates:
unknown import: `foo::bar` has not been defined
The latter error message here is much better than the former. The reason for this is how Wasmtime reinterprets two-level imports as single-level-imports-of-instances, but the error message generation doesn't do a great job of taking this into account.
Last updated: Dec 23 2024 at 12:05 UTC