Stream: wasmtime

Topic: Compiling wasmtime on OpenBSD 7.5


view this post on Zulip Frank Rehwinkel (Jun 27 2024 at 19:24):

Tried to do a 'cargo install wasmtime-cli' on an OpenBSD 7.5 where I have cargo (cargo 1.76.0) and even cargo-component (cargo-component 0.13.2 (wasi:040ec92)) compiled. But as OpenBSD is not an OS that is compiled for very often, no surprise it didn't work. Any suggestions how I should proceed given this first error?

   Compiling wasmtime-wasi v22.0.0
error[E0425]: cannot find function `set_tcp_keepidle` in module `sockopt`
    --> /home/frank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-wasi-22.0.0/src/host/network.rs:409:18
     |
409  |         sockopt::set_tcp_keepidle(
     |                  ^^^^^^^^^^^^^^^^ not found in `sockopt`
     |
note: found an item that was configured out
    --> /home/frank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.34/src/net/sockopt.rs:1192:8
     |
1192 | pub fn set_tcp_keepidle<Fd: AsFd>(fd: Fd, value: Duration) -> io::Result<()> {
     |        ^^^^^^^^^^^^^^^^
help: consider importing this function
     |
221  +     use crate::host::network::util::set_tcp_keepidle;
     |
help: if you import `set_tcp_keepidle`, refer to it directly
     |
409  -         sockopt::set_tcp_keepidle(
409  +         set_tcp_keepidle(
     |

view this post on Zulip Alex Crichton (Jun 27 2024 at 19:29):

you'll probably want a #[cfg] on that line in wasmtime-wasi to return an error on OpenBSD

view this post on Zulip Chris Fallin (Jun 27 2024 at 19:31):

and in general the path I took when I bulldozed through and got openbsd working at one point was to either add the relevant syscall support in the rustix/cap-std universe of crates, or conditionalize more as Alex says

view this post on Zulip Chris Fallin (Jun 27 2024 at 19:31):

modern wasmtime has more in its default config, e.g. wasmtime serve, that might make this a bit harder; if needed you could build without those features as well

view this post on Zulip Frank Rehwinkel (Jun 27 2024 at 19:32):

Good point. I should start with a minimal feature set and see if it can compile, and then add features to get a lay of the land.


Last updated: Dec 23 2024 at 13:07 UTC