File tree Expand file tree Collapse file tree 4 files changed +14
-1087
lines changed
python/functionstream-runtime
src/runtime/processor/wasm Expand file tree Collapse file tree 4 files changed +14
-1087
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
1919
2020WIT_DIR=" $SCRIPT_DIR /wit"
2121PROJECT_WIT_FILE=" $PROJECT_ROOT /wit/processor.wit"
22- WIT_DEPS_DIR=" $WIT_DIR /deps"
22+ WIT_DEPS_DIR=" $PROJECT_ROOT /wit /deps"
2323
2424BINDINGS_DIR=" $SCRIPT_DIR /bindings"
2525BUILD_DIR=" $SCRIPT_DIR /build"
@@ -56,7 +56,12 @@ mkdir -p "$BINDINGS_DIR" "$BUILD_WIT_DIR/deps"
5656cp " $PROJECT_WIT_FILE " " $BUILD_WIT_DIR /processor.wit"
5757cp -a " $WIT_DEPS_DIR /." " $BUILD_WIT_DIR /deps/"
5858
59- # 3. Generate Bindings
59+ if ! command -v wit-bindgen-go & > /dev/null; then
60+ echo " wit-bindgen-go not found. Installing..."
61+ go install go.bytecodealliance.org/cmd/wit-bindgen-go@latest
62+ export PATH=$PATH :$( go env GOPATH) /bin
63+ fi
64+
6065wit-bindgen-go generate \
6166 --world processor \
6267 --out " $BINDINGS_DIR " \
@@ -72,7 +77,7 @@ mkdir -p "$(dirname "$OUTPUT_FILE")"
7277tinygo build -target=wasip2 \
7378 -tags purego \
7479 -wit-package " $BUILD_WIT_DIR " \
75- -wit-world processor \
80+ -wit-world processor-runtime \
7681 -o " $OUTPUT_FILE " " $SCRIPT_DIR /main.go"
7782
7883# 5. Optional Post-Build Validation
Original file line number Diff line number Diff line change 4040
4141FS_API_DIR = SCRIPT_DIR .parent / "functionstream-api"
4242
43- WORLD_NAME = "processor"
43+ WORLD_NAME = "processor-runtime "
4444MAIN_MODULE = "fs_runtime.runner"
4545
4646logging .basicConfig (level = logging .INFO , format = "%(asctime)s [%(levelname)s] %(message)s" )
@@ -124,7 +124,6 @@ def build_wasm(self):
124124 "-d" , str (WIT_DIR .absolute ()),
125125 "-w" , WORLD_NAME ,
126126 "componentize" ,
127- "--stub-wasi" ,
128127 "-p" , str (DEPENDENCIES_DIR .absolute ()),
129128 "-p" , str (SRC_DIR .absolute ()),
130129 MAIN_MODULE ,
You can’t perform that action at this time.
0 commit comments