Skip to content

Commit

Permalink
Updates to supported Go version and wazero beta (#38)
Browse files Browse the repository at this point in the history
Per go support policy, the floor version is 1.18 now. This also moves to
wazero's 1.0.0-beta.2 tag.

Signed-off-by: Adrian Cole <[email protected]>

Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
codefromthecrypt authored Aug 31, 2022
1 parent fb3f00b commit 6f8fc25
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions engines/wazero/wazero.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/api"
"github.com/tetratelabs/wazero/assemblyscript"
"github.com/tetratelabs/wazero/wasi_snapshot_preview1"
"github.com/tetratelabs/wazero/imports/assemblyscript"
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"

"github.com/wapc/wapc-go"
)
Expand All @@ -24,6 +24,7 @@ const functionStart = "_start"
const functionInit = "wapc_init"

// functionGuestCall is a callback required to be exported. Below is its signature in WebAssembly 1.0 (MVP) Text Format:
//
// (func $__guest_call (param $operation_len i32) (param $payload_len i32) (result (;errno;) i32))
const functionGuestCall = "__guest_call"

Expand Down Expand Up @@ -157,9 +158,9 @@ type wapcHost struct {
}

// instantiateWapcHost instantiates a wapcHost and returns it and its corresponding module, or an error.
// - r: used to instantiate the waPC host module
// - callHandler: used to implement hostCall
// - logger: used to implement consoleLog
// - r: used to instantiate the waPC host module
// - callHandler: used to implement hostCall
// - logger: used to implement consoleLog
func instantiateWapcHost(ctx context.Context, r wazero.Runtime, callHandler wapc.HostCallHandler, logger wapc.Logger) (api.Module, error) {
h := &wapcHost{callHandler: callHandler, logger: logger}
// Export host functions (in the order defined in https://wapc.io/docs/spec/#required-host-exports)
Expand Down
2 changes: 1 addition & 1 deletion engines/wazero/wazero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/wasi_snapshot_preview1"
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"

"github.com/wapc/wapc-go"
)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/wapc/wapc-go

go 1.17
go 1.18

require (
github.com/Workiva/go-datastructures v1.0.53
github.com/bytecodealliance/wasmtime-go v0.39.0
github.com/tetratelabs/wazero v0.0.0-20220818123113-1948909ec0b1
github.com/tetratelabs/wazero v1.0.0-beta.2
github.com/wasmerio/wasmer-go v1.0.4
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tetratelabs/wazero v0.0.0-20220818123113-1948909ec0b1 h1:TjQhlrtayR+3VpwtMbxjXhGxRmNcdMUQn4eFUoFfkWs=
github.com/tetratelabs/wazero v0.0.0-20220818123113-1948909ec0b1/go.mod h1:CD5smBN5rGZo7UNe8aUiWyYE3bDWED/CQSonog9NSEg=
github.com/tetratelabs/wazero v1.0.0-beta.2 h1:Qa1R1oizAYHcmy8PljgINdXUZ/nRQkxUBbYfGSb4IBE=
github.com/tetratelabs/wazero v1.0.0-beta.2/go.mod h1:CD5smBN5rGZo7UNe8aUiWyYE3bDWED/CQSonog9NSEg=
github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg=
github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q=
github.com/wasmerio/wasmer-go v1.0.4 h1:MnqHoOGfiQ8MMq2RF6wyCeebKOe84G88h5yv+vmxJgs=
Expand Down

0 comments on commit 6f8fc25

Please sign in to comment.