Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 7d86118

Browse files
committed
use nightly TinyGo: WASI supported version
Signed-off-by: mathetake <[email protected]>
1 parent 2249c7f commit 7d86118

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

.github/workflows/workflow.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,11 @@ jobs:
2626
name: build examples
2727
runs-on: ubuntu-latest
2828
container:
29-
image: tinygo/tinygo:0.15.0
29+
image: getenvoy/extension-tinygo-builder:latest
3030
steps:
3131
- name: checkout
3232
uses: actions/checkout@v2
3333

34-
- name: set up go 1.15
35-
uses: actions/setup-go@v1
36-
with:
37-
go-version: 1.15
38-
3934
- name: build examples
4035
run: find ./examples -type f -name "main.go" | xargs -Ip tinygo build -o p.wasm -target=wasm -wasm-abi=generic p
4136

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ help:
77
grep -E '^[a-z0-9A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
88

99
build.example:
10-
tinygo build -o ./examples/${name}/main.go.wasm -target=wasm -wasm-abi=generic ./examples/${name}/main.go
10+
docker run -it -w /tmp/proxy-wasm-go --entrypoint='/bin/bash' -v $(shell pwd):/tmp/proxy-wasm-go getenvoy/extension-tinygo-builder:latest \
11+
-c 'tinygo build -o ./examples/${name}/main.go.wasm -target=wasi -wasm-abi=generic ./examples/${name}/main.go'
1112

1213
build.examples:
13-
find ./examples -type f -name "main.go" | xargs -Ip tinygo build -o p.wasm -target=wasm -wasm-abi=generic p
14+
docker run -it -w /tmp/proxy-wasm-go --entrypoint='/bin/bash' -v $(shell pwd):/tmp/proxy-wasm-go getenvoy/extension-tinygo-builder:latest \
15+
-c 'find ./examples -type f -name "main.go" | xargs -Ip tinygo build -o p.wasm -target=wasi -wasm-abi=generic p'
1416

1517
lint:
1618
golangci-lint run --build-tags proxytest

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ func (ctx *context) OnHttpRequestHeaders(int, bool) types.Action {
3535

3636
```
3737

38-
39-
### requirements
40-
41-
- TinyGo(0.15.0+): https://tinygo.org
42-
4338
### compatible Envoy builds
4439

4540
| proxy-wasm-go-sdk| proxy-wasm ABI version | envoyproxy/envoy-wasm| istio/proxyv2|
@@ -95,7 +90,7 @@ make test.e2e # run e2e tests
9590
with `-gc=none` option. This is the future TODO.
9691
- `recover` is [not implemented](https://github.com/tinygo-org/tinygo/issues/891) in TinyGo, and there's no way to prevent the WASM virtual machine from aborting.
9792
- Be careful about using Goroutine
98-
- In Tinygo, Goroutine is implmeneted through LLVM's coroutine (see [this blog post](https://aykevl.nl/2019/02/tinygo-goroutines)).
93+
- In TinyGo, Goroutine is implmeneted through LLVM's coroutine (see [this blog post](https://aykevl.nl/2019/02/tinygo-goroutines)).
9994
- Make every goroutine exit as soon as possible, otherwise it will block the proxy's worker thread. That is too bad for processing realtime network requests.
10095
- We strongly recommend that you implement the `OnTick` function for any asynchronous task instead of using Goroutine so we do not block requests.
10196

0 commit comments

Comments
 (0)