Skip to content

Releases: wapc/wapc-guest-tinygo

wazero beta

01 Sep 00:28
cb14bee
Compare
Choose a tag to compare
deps: updates wazero to 1.0.0-beta.2 (#11)

A bug in beta1 was fixed and released in beta2 tetratelabs/wazero#783

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

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

Add ConsoleLog

19 Aug 01:01
3b882ae
Compare
Choose a tag to compare
ci: fixes broken test setup (#9)

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

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

Fix Wasm modules built with TinyGo >= 0.19.0

24 Jul 01:01
0b8458c
Compare
Choose a tag to compare
Fix Wasm modules built with tinygo later than 0.19.0 (#7)

Wasm binaries built using with TinyGo >= 0.19.0 did not work properly

The final `.wasm` binary are not importing the waPC functions from the
host, they are instead using the "stub" ones defined inside of the
`imports.go` file.

That happened when building a go program using the `wasi` target:

```
tinygo build -o policy.wasm -target=wasi .
```

That DID NOT happen when building against the `wasm` target:

```
tinygo build -o policy.wasm -target=wasm .
```

This happens because TinyGo changed the build tag used to identify Wasm
binaries. It went from being `wasm` to be `tinygo.wasm`.
Go performs conditional compilation looking **also** at the suffix of
the `.go` files.

As a result of that, the `imports_wasm.go` was no longer loaded by
the `go/build` package. That, associated with the build condition
set via the `// +build` directive, lead the stub functions defined
inside of `imports.go` to be used.

Updating the build directives inside of `imports.go` and
`imports_wasm.go` is **not** enough. That's because, when building with
the `wasi` target, the compiler will not analyze the `imports_wasm.go`;
its suffix indicates it belongs to a different architecture -> it's
ignored.

This commit fixes the issue by:

  * Renaming the `imports_wasm.go` to have a "neutral" name
  * Extend the `// +build` directives inside of the import files

Note well: the `wasm` directive is kept around to ensure programs
build with TinyGo < 0.19.0 keep working as expected.

Signed-off-by: Flavio Castelli <[email protected]>

Improved compilation and testing / Tweaked registration

01 Oct 17:43
f05bbfb
Compare
Choose a tag to compare
  • Making this module both TinyGo and Go friendly for compilation and testing
  • Tweaking registration functions