Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 56 additions & 42 deletions .CurrentChangelog.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,62 @@
### v0.14.0 (2025-02-14)
### v0.17.1 (2026-07-10)

Breaking Changes:

* Removed `wasmedge.ValType` and `wasmedge.RefType` const values, and introduce the `wasmedge.ValType` struct.
* Added the `wasmedge.NewValTypeI32()` API to replace the `wasmedge.ValType_I32` const value.
* Added the `wasmedge.NewValTypeI64()` API to replace the `wasmedge.ValType_I64` const value.
* Added the `wasmedge.NewValTypeF32()` API to replace the `wasmedge.ValType_F32` const value.
* Added the `wasmedge.NewValTypeF64()` API to replace the `wasmedge.ValType_F64` const value.
* Added the `wasmedge.NewValTypeV128()` API to replace the `wasmedge.ValType_V128` const value.
* Added the `wasmedge.NewValTypeFuncRef()` API to replace the `wasmedge.ValType_FuncRef` const value.
* Added the `wasmedge.NewValTypeExternRef()` API to replace the `wasmedge.ValType_ExterunRef` const value.
* Added the `(*wasmedge.ValType).IsEqual()` API to compare the equivalent of two value types.
* Added the `(*wasmedge.ValType).IsI32()` API to specify the value type is `i32` or not.
* Added the `(*wasmedge.ValType).IsI64()` API to specify the value type is `i64` or not.
* Added the `(*wasmedge.ValType).IsF32()` API to specify the value type is `f32` or not.
* Added the `(*wasmedge.ValType).IsF64()` API to specify the value type is `f64` or not.
* Added the `(*wasmedge.ValType).IsV128()` API to specify the value type is `v128` or not.
* Added the `(*wasmedge.ValType).IsFuncRef()` API to specify the value type is `funcref` or not.
* Added the `(*wasmedge.ValType).IsExternRef()` API to specify the value type is `externref` or not.
* Added the `(*wasmedge.ValType).IsRef()` API to specify the value type is a reference type or not.
* Added the `(*wasmedge.ValType).IsRefNull()` API to specify the value type is a nullable reference type or not.
* Updated the supported WASM proposals.
* Added the `wasmedge.Proposal.GC`.
* Added the `wasmedge.Proposal.RELAXED_SIMD`.
* Added the `wasmedge.Proposal.COMPONENT_MODEL`.
* Added the error return in `(*wasmedge.Global).SetValue()` API.
* Applied the new `wasmedge.ValType` struct to all related APIs.
* `wasmedge.NewFunctionType()` accepts the new `[]*wasmedge.ValType` for parameters now.
* `(*wasmedge.FunctionType).GetParameters()` returns the new `[]*wasmedge.ValType` now.
* `(*wasmedge.FunctionType).GetReturns()` returns the new `[]*wasmedge.ValType` now.
* `wasmedge.NewTableType()` accepts the new `*wasmedge.ValType` instead of `wasmedge.RefType` for parameters now.
* `(*wasmedge.TableType).GetRefType()` returns the new `*wasmedge.ValType` now.
* `wasmedge.NewGlobalType()` accepts the new `*wasmedge.ValType` for parameters now.
* `(*wasmedge.GlobalType).GetValType()` returns the new `*wasmedge.ValType` now.
* Updated to the [WasmEdge 0.17.1](https://github.com/WasmEdge/WasmEdge/releases/tag/0.17.1) C API.
* Removed all wasm-bindgen related APIs. Please use the [wasmedge-bindgen](https://github.com/second-state/wasmedge-bindgen) project or plain WASM functions instead.
* Removed the `(*wasmedge.VM).ExecuteBindgen()` API.
* Removed the `(*wasmedge.VM).ExecuteBindgenRegistered()` API.
* Removed the `wasmedge.Bindgen_return_void`, `wasmedge.Bindgen_return_i32`, `wasmedge.Bindgen_return_i64`, and `wasmedge.Bindgen_return_array` const values.
* Removed the force-interpreter configuration in favor of the new run mode configuration.
* Removed the `(*wasmedge.Configure).SetForceInterpreter()` API. Please use the `(*wasmedge.Configure).SetRunMode()` API instead.
* Removed the `(*wasmedge.Configure).IsForceInterpreter()` API. Please use the `(*wasmedge.Configure).GetRunMode()` API instead.
* Changed the `wasmedge.Limit` into a context type like the other types, along with the `WasmEdge_LimitContext` introduced in the WasmEdge 0.17.1 C API.
* The `wasmedge.NewLimit*()` APIs create a limit context now, and developers should call the `(*wasmedge.Limit).Release()` API to destroy it after use.
* The `(*wasmedge.TableType).GetLimit()` and `(*wasmedge.MemoryType).GetLimit()` APIs return a limit reference which is valid while the type context is valid.
* Removed the `wasmedge.NewLimitShared()` API: shared limits require a maximum value in WasmEdge 0.17.1. Please use the `wasmedge.NewLimitSharedWithMax()` API instead.
* Changed the `(*wasmedge.VM).ForceDeleteRegisteredModule()` semantics along with the WasmEdge C API: the module instance is destroyed, and any Go wrapper of it must not be released afterwards.

Features:

* Updated to the [WasmEdge 0.14.0](https://github.com/WasmEdge/WasmEdge/releases/tag/0.14.0).
* Added the new `(*wasmedge.Compiler).CompileBuffer()` API for compiling WASM from buffer.
* Added the tag type and tag instance for the exception-handling proposal.
* Added the `wasmedge.ExternType_Tag` const value.
* Added the `wasmedge.TagType` struct for tag type.
* Added the `(*wasmedge.TagType).GetFunctionType()` API.
* Added the `wasmedge.Tag` struct for tag instance.
* Added the `(*wasmedge.Tag).GetTagType()` API.
* Added the `(*wasmedge.Module).FindTag()` API to retrieve exported tag instances from a module instance.
* Added the `(*wasmedge.Module).ListTag()` API to list all exported tag instance names from a module instance.
* Added the run mode configuration for selecting the execution engine.
* Added the `wasmedge.RunMode_Interpreter`, `wasmedge.RunMode_JIT`, and `wasmedge.RunMode_AOT` const values.
* Added the `(*wasmedge.Configure).SetRunMode()` API.
* Added the `(*wasmedge.Configure).GetRunMode()` API.
* Added the WASM standard configuration.
* Added the `wasmedge.Standard_WASM_1`, `wasmedge.Standard_WASM_2`, and `wasmedge.Standard_WASM_3` const values.
* Added the `(*wasmedge.Configure).SetWASMStandard()` API.
* Added the log level APIs.
* Added the `wasmedge.LogLevel_Trace`, `wasmedge.LogLevel_Debug`, `wasmedge.LogLevel_Info`, `wasmedge.LogLevel_Warn`, `wasmedge.LogLevel_Error`, and `wasmedge.LogLevel_Critical` const values.
* Added the `wasmedge.SetLogLevel()` API.
* Added the 64-bit limits for the memory64 proposal.
* Added the `wasmedge.NewLimit64()`, `wasmedge.NewLimit64WithMax()`, and `wasmedge.NewLimit64SharedWithMax()` APIs.
* Added the `(*wasmedge.Limit).Is64Bit()` API.
* Added the `(*wasmedge.Limit).IsEqual()` API.
* The memory and table instance APIs use 64-bit offsets and sizes internally now.
* Added the WASI module creation with custom file descriptors.
* Added the `wasmedge.NewWasiModuleWithFds()` API.
* Added the `(*wasmedge.Module).InitWasiWithFds()` API.
* Added the module registration with alias names.
* Added the `(*wasmedge.VM).RegisterModuleWithAlias()` API.
* Added the `(*wasmedge.VM).ForceDeleteRegisteredModule()` API.
* Added the `(*wasmedge.Executor).RegisterImportWithAlias()` API.
* Added the reference value helpers.
* Added the `wasmedge.Ref` struct for the GC proposal references with the `IsNull()` and `GetValType()` APIs.
* Added the `(wasmedge.FuncRef).IsNull()` and `(wasmedge.ExternRef).IsNull()` APIs.
* Added the `wasmedge.NewNullExternRef()` API, and `wasmedge.NewFuncRef(nil)` creates a null function reference now.

Fixes:

* Fixed the `wasmedge.NewExternRef()` crash with WasmEdge 0.17.x: the reference values are generated through the C API now instead of forging the value payload.
* Fixed the nil pointer dereference in the `(*wasmedge.FunctionType).GetParameters()` and `(*wasmedge.FunctionType).GetReturns()` APIs.
* Fixed the maximum memory page configuration to use the full 64-bit range.

Tests:

* Added the unit tests for the API surface of the `wasmedge` package.
* Added the WASM specification test suites in the interpreter, AOT, and JIT modes under the `spectest` package.

Misc:

* Updated the minimum Go version to 1.25.
* Updated the CI workflows to WasmEdge 0.17.1 and Go 1.25/1.26, and enabled the new tests.
21 changes: 14 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
USE_BAZEL_VERSION: 7.4.1
strategy:
matrix:
go: [ '1.22.x', '1.23.x' ]
go: [ '1.25.x', '1.26.x' ]
name: Build WasmEdge-go on Ubuntu 24.04 x86_64 with Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v6
Expand All @@ -34,11 +34,15 @@ jobs:
run: go version
- name: Install wasmedge
run: |
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v 0.14.0
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- -v 0.17.1
- name: Build WasmEdge-go
run: |
source $HOME/.wasmedge/env
go build ./wasmedge/
- name: Unit tests
run: |
source $HOME/.wasmedge/env
go test ./wasmedge/ -count=1
- name: Bazel Test
run: |
bazel test //... \
Expand All @@ -56,8 +60,8 @@ jobs:
USE_BAZEL_VERSION: 7.4.1
strategy:
matrix:
go: [ '1.22.x', '1.23.x' ]
name: Build WasmEdge-go on MacOS 14 x86_64 with Go ${{ matrix.go }}
go: [ '1.25.x', '1.26.x' ]
name: Build WasmEdge-go on macOS 14 arm64 with Go ${{ matrix.go }}
steps:
- uses: actions/checkout@v6
- name: Install go
Expand All @@ -68,12 +72,15 @@ jobs:
run: go version
- name: Install wasmedge
run: |
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v 0.14.0
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- -v 0.17.1
- name: Build WasmEdge-go
run: |
source $HOME/.wasmedge/env
go build ./wasmedge/

- name: Unit tests
run: |
source $HOME/.wasmedge/env
go test ./wasmedge/ -count=1
- name: Bazel Test
run: |
bazel test //... \
Expand All @@ -82,4 +89,4 @@ jobs:
--linkopt="-L$HOME/.wasmedge/lib" \
--action_env=LD_LIBRARY_PATH=$HOME/.wasmedge/lib \
--action_env=DYLD_LIBRARY_PATH=$HOME/.wasmedge/lib \
--@io_bazel_rules_go//go/config:pure=false
--@io_bazel_rules_go//go/config:pure=false
136 changes: 11 additions & 125 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
go: [ '1.22.x', '1.23.x' ]
go: [ '1.25.x', '1.26.x' ]
name: Run WasmEdge-go-examples in AOT mode with Go ${{ matrix.go }}

steps:

- name: Checkout code
uses: actions/checkout@v6

- name: Install apt-get packages
run: |
sudo ACCEPT_EULA=Y apt-get update
Expand All @@ -38,7 +41,11 @@ jobs:

- name: Install WasmEdge
run: |
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local --plugins wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image -v 0.14.0
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local --plugins wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image -v 0.17.1

- name: WASM spec tests
run: |
go test ./spectest/ -count=1 -timeout 60m

- name: Install the examples
run: |
Expand Down Expand Up @@ -106,70 +113,6 @@ jobs:
wasmedgec greet.wasm out.wasm
./greet_memory out.wasm

- name: go_BindgenFuncs
run: |
cd wasmedge-go-examples/go_BindgenFuncs
go get .
go build
wasmedgec rust_bindgen_funcs_lib.wasm out.wasm
./bindgen_funcs out.wasm

- name: go_BindgenKmeans
run: |
cd wasmedge-go-examples/go_BindgenKmeans
go get .
go build
wasmedgec rust_bindgen_kmeans_lib.wasm out.wasm
./bindgen_kmeans out.wasm

- name: go_BindgenWasi
run: |
cd wasmedge-go-examples/go_BindgenWasi
go get .
go build
wasmedgec rust_bindgen_wasi_lib.wasm out.wasm
./bindgen_wasi out.wasm

- name: go_Mobilenet
run: |
cd wasmedge-go-examples/go_Mobilenet
go get .
go build
wasmedgec rust_mobilenet_lib.wasm out.wasm
./mobilenet out.wasm grace_hopper.jpg

- name: go_MobilenetBirds
run: |
cd wasmedge-go-examples/go_MobilenetBirds
go get .
go build
wasmedgec rust_mobilenet_birds_lib.wasm out.wasm
./mobilenet_birds out.wasm PurpleGallinule.jpg

- name: go_MobilenetFood
run: |
cd wasmedge-go-examples/go_MobilenetFood
go get .
go build
wasmedgec rust_mobilenet_food_lib.wasm out.wasm
./mobilenet_food out.wasm food.jpg

- name: go_MobilenetInsects
run: |
cd wasmedge-go-examples/go_MobilenetInsects
go get .
go build
wasmedgec rust_mobilenet_insects_lib.wasm out.wasm
./mobilenet_insects out.wasm ladybug.jpg

- name: go_MobilenetPlants
run: |
cd wasmedge-go-examples/go_MobilenetPlants
go get .
go build
wasmedgec rust_mobilenet_plants_lib.wasm out.wasm
./mobilenet_plants out.wasm sunflower.jpg

- name: go_mtcnn
run: |
cd wasmedge-go-examples/go_mtcnn
Expand All @@ -184,7 +127,7 @@ jobs:

strategy:
matrix:
go: [ '1.22.x', '1.23.x' ]
go: [ '1.25.x', '1.26.x' ]
name: Run WasmEdge-go-examples in interpreter mode with Go ${{ matrix.go }}

steps:
Expand All @@ -205,7 +148,7 @@ jobs:

- name: Install WasmEdge
run: |
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local --plugins wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image -v 0.14.0
wget -qO- https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | sudo bash -s -- -p /usr/local --plugins wasmedge_tensorflow wasmedge_tensorflowlite wasmedge_image -v 0.17.1

- name: Install the examples
run: |
Expand Down Expand Up @@ -274,63 +217,6 @@ jobs:
go build greet_memory.go
./greet_memory greet.wasm

- name: go_BindgenFuncs
run: |
cd wasmedge-go-examples/go_BindgenFuncs
go get .
go build
./bindgen_funcs rust_bindgen_funcs_lib.wasm

# Not to run this example in interpreter mode to reduce CI time.
#- name: go_BindgenKmeans
# run: |
# cd wasmedge-go-examples/go_BindgenKmeans
# go get .
# go build
# ./bindgen_kmeans rust_bindgen_kmeans_lib.wasm

- name: go_BindgenWasi
run: |
cd wasmedge-go-examples/go_BindgenWasi
go get .
go build
./bindgen_wasi rust_bindgen_wasi_lib.wasm

- name: go_Mobilenet
run: |
cd wasmedge-go-examples/go_Mobilenet
go get .
go build
./mobilenet rust_mobilenet_lib.wasm grace_hopper.jpg

- name: go_MobilenetBirds
run: |
cd wasmedge-go-examples/go_MobilenetBirds
go get .
go build
./mobilenet_birds rust_mobilenet_birds_lib.wasm PurpleGallinule.jpg

- name: go_MobilenetFood
run: |
cd wasmedge-go-examples/go_MobilenetFood
go get .
go build
./mobilenet_food rust_mobilenet_food_lib.wasm food.jpg

- name: go_MobilenetInsects
run: |
cd wasmedge-go-examples/go_MobilenetInsects
go get .
go build
./mobilenet_insects rust_mobilenet_insects_lib.wasm ladybug.jpg

- name: go_MobilenetPlants
run: |
cd wasmedge-go-examples/go_MobilenetPlants
go get .
go build
./mobilenet_plants rust_mobilenet_plants_lib.wasm sunflower.jpg

- name: go_mtcnn
run: |
cd wasmedge-go-examples/go_mtcnn
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ docs/_build
pkg/
target/
Cargo.lock

# Downloaded WASM spec test suites.
spectest/testdata/
Loading
Loading