Stream: wasmtime

Topic: ✔ can't compile wasmtime-cli


view this post on Zulip Marco Ieni (Apr 27 2024 at 15:38):

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`

view this post on Zulip Peter Huene (Apr 27 2024 at 19:26):

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?

view this post on Zulip Marco Ieni (Apr 27 2024 at 20:23):

that worked, thanks! Should we add this somewhere in the readme maybe?

view this post on Zulip Peter Huene (Apr 27 2024 at 21:46):

It's currently documented here: https://docs.wasmtime.dev/contributing-building.html#git-submodules

view this post on Zulip Peter Huene (Apr 27 2024 at 21:46):

which is linked to in the README under the Contributing header

view this post on Zulip Marco Ieni (Apr 28 2024 at 12:39):

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 :)

view this post on Zulip Notification Bot (Apr 28 2024 at 12:39):

Marco Ieni has marked this topic as resolved.

view this post on Zulip Ralph (Apr 28 2024 at 19:01):

multiple redirects isn't the easiest way to discover things, I agree.

view this post on Zulip Andrew Brown (May 02 2024 at 17:28):

@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!

To more closely align with the conventions in the wasmtime-wasi and wasmtime-wasi-http crates, this change removes the Git submodule that previously provided the WIT and WITX files for wasmtime-was...

view this post on Zulip Marco Ieni (May 02 2024 at 19:53):

that's great, thank you :heart:


Last updated: Dec 23 2024 at 14:03 UTC