Skip to content

Commit f7d9444

Browse files
deps: updates wazero to 1.0.0-pre.4 (#13)
Signed-off-by: Adrian Cole <[email protected]>
1 parent 36abc42 commit f7d9444

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GOPATH := $(shell go env GOPATH)
22
GOBIN := $(if $(GOPATH),$(GOPATH)/bin,/usr/local/bin)
33

4-
go_sources := $(shell find cmd encoding gen genid version wasm -name "*.go")
4+
go_sources := $(shell find cmd encoding gen genid version wasm -name "*.go")
55

66
.PHONY: build
77
build: $(GOBIN)/protoc-gen-go-plugin
@@ -20,7 +20,6 @@ build.tests: $(tinygo_tests:.go=.wasm)
2020
%.wasm: %.go $(GOBIN)/protoc-gen-go-plugin
2121
tinygo build -o $@ -scheduler=none --no-debug --target=wasi $<
2222

23-
2423
proto_files := $(shell find . -name "*.proto")
2524
.PHONY: protoc
2625
protoc: $(proto_files:.proto=.pb.go) $(proto_files:.proto=_vtproto.pb.go)

examples/host-functions/greeting/greet_host.pb.go

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/host.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ func (gg *Generator) genHostFunctions(g *protogen.GeneratedFile, f *fileInfo) {
6969
}`
7070
for _, method := range f.hostService.Methods {
7171
g.P(method.Comments.Leading, fmt.Sprintf(`
72-
func (h %s) _%s(ctx %s, m %s, params []uint64) []uint64 {`,
72+
func (h %s) _%s(ctx %s, m %s, stack []uint64) {`,
7373
structName,
7474
method.GoName,
7575
g.QualifiedGoIdent(contextPackage.Ident("Context")),
7676
g.QualifiedGoIdent(wazeroAPIPackage.Ident("Module")),
7777
))
78-
g.P("offset, size := uint32(params[0]), uint32(params[1])")
78+
g.P("offset, size := uint32(stack[0]), uint32(stack[1])")
7979
g.P("buf, err := ", g.QualifiedGoIdent(pluginWasmPackage.Ident("ReadMemory")), "(ctx, m, offset, size)")
8080
g.P(errorHandling)
8181

@@ -93,7 +93,7 @@ func (gg *Generator) genHostFunctions(g *protogen.GeneratedFile, f *fileInfo) {
9393
g.P(errorHandling)
9494

9595
g.P("ptrLen := (ptr << uint64(32)) | uint64(len(buf))")
96-
g.P("return []uint64{ptrLen}")
96+
g.P("stack[0] = ptrLen")
9797
g.P("}")
9898
}
9999
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
require (
66
github.com/planetscale/vtprotobuf v0.3.0
77
github.com/stretchr/testify v1.7.1
8-
github.com/tetratelabs/wazero v1.0.0-pre.3
8+
github.com/tetratelabs/wazero v1.0.0-pre.4
99
google.golang.org/protobuf v1.28.1
1010
)
1111

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
1010
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1111
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
1212
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
13-
github.com/tetratelabs/wazero v1.0.0-pre.3 h1:Z5fbogMUGcERzaQb9mQU8+yJSy0bVvv2ce3dfR4wcZg=
14-
github.com/tetratelabs/wazero v1.0.0-pre.3/go.mod h1:M8UDNECGm/HVjOfq0EOe4QfCY9Les1eq54IChMLETbc=
13+
github.com/tetratelabs/wazero v1.0.0-pre.4 h1:RBJQT5OzmORkSp6MmZDWoFEr0zXjk4pmvMKAdeUnsaI=
14+
github.com/tetratelabs/wazero v1.0.0-pre.4/go.mod h1:u8wrFmpdrykiFK0DFPiFm5a4+0RzsdmXYVtijBKqUVo=
1515
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
1616
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
1717
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

tests/host-functions/proto/host_host.pb.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)