Bug 274948 - [NEW PORT] emulators/wasmtime, devel/libwasmtime: add wasmtime CLI support
Summary: [NEW PORT] emulators/wasmtime, devel/libwasmtime: add wasmtime CLI support
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sergey A. Osokin
URL: https://wasmtime.dev/
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-07 01:21 UTC by Eric Camachat
Modified: 2023-11-09 16:10 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (osa)


Attachments
add wasmtime CLI support (2.37 KB, patch)
2023-11-07 01:21 UTC, Eric Camachat
no flags Details | Diff
move wasmtime cli into emulators (3.59 KB, patch)
2023-11-09 03:26 UTC, Eric Camachat
eric: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Camachat 2023-11-07 01:21:42 UTC
Created attachment 246171 [details]
add wasmtime CLI support
Comment 1 Eric Camachat 2023-11-07 01:22:45 UTC
Add a slave port to build wasmtime CLI.
Comment 2 Eric Camachat 2023-11-09 03:26:11 UTC
Created attachment 246209 [details]
move wasmtime cli into emulators

move wasmtime cli into emulators and add an rc file to register wasmtime as interpreter by binmiscctl.
Comment 3 Eric Camachat 2023-11-09 03:33:14 UTC
Tested on my local FreeBSD:

> cat << _EOF_ > hello-wasm.c
#include <stdio.h>
int main(int argc, char *argv[]) {
        printf("Hello WebASM\n");
        return 0;
}
_EOF_

> clang17 --target=wasm32-wasi --sysroot=/usr/local/share/wasi-sysroot -o hello-wasm hello-wasm.c

> ./hello-wasm
exec: Failed to execute process: 'hello-wasm' the file could not be run by the operating system.

> sudo pkg install -y emulators/wasmtime

> sudo service wasmtime onestart

> ./hello-wasm
Hello WebASM

> sudo service wasmtime onestop

> ./hello-wasm
exec: Failed to execute process: 'hello-wasm' the file could not be run by the operating system.
Comment 4 Sergey A. Osokin freebsd_committer freebsd_triage 2023-11-09 16:10:45 UTC
Hi Eric,

thanks for the report.

I'd prefer to see lang/wasmtime as a separate port, independent on devel/libwasmtime.