Hi, I'm trying to compile wasmtime but I get an error.
Am I missing a step to generate some code?
$ cargo build -p wasmtime-cli
Compiling wasmtime-wasi-nn v21.0.0 (/Users/marcoieni/me/proj/wasmtime/crates/wasi-nn)
warning: wasmtime-cli@21.0.0: The spec testsuite is disabled. To enable, run `git submodule update --remote`.
warning: wasmtime-cli@21.0.0: The spec testsuite is disabled. To enable, run `git submodule update --remote`.
error[E0407]: method `init_execution_context` is not a member of trait `gen::inference::Host`
--> crates/wasi-nn/src/wit.rs:75:5
|
75 | / fn init_execution_context(
76 | | &mut self,
77 | | graph_id: gen::graph::Graph,
78 | | ) -> wasmtime::Result<Result<gen::inference::GraphExecutionContext, gen::errors::Error>> {
... |
86 | | Ok(Ok(exec_context_id))
87 | | }
| |_____^ not a member of trait `gen::inference::Host`
The wasi-nn
spec is sourced via a git submodule, which might be out of date with the implementation in your local wasmtime repo. Does a git submodule update --init
help?
that worked, thanks! Should we add this somewhere in the readme maybe?
It's currently documented here: https://docs.wasmtime.dev/contributing-building.html#git-submodules
which is linked to in the README under the Contributing
header
Oh nice. I was pair programming with a friend of mine, and neither I nor I found it. I wonder if this command could be run from build.rs
to avoid requiring this manual step :see_no_evil:
Anyway, thank you for your help :)
Marco Ieni has marked this topic as resolved.
multiple redirects isn't the easiest way to discover things, I agree.
@Marco Ieni, I just saw this issue and had been thinking of doing this for a bit: the only reason wasi-nn pulls from a submodule is because other WASI crates did so. But they've moved toward duplicating the WIT files in-tree so I decided that would be good here as well. The following change removes the submodule you ran into: https://github.com/bytecodealliance/wasmtime/pull/8519. Hopefully that removes this common "forgot to pull submodules" trip-up!
that's great, thank you :heart:
Last updated: Nov 22 2024 at 16:03 UTC