diff --git a/.github/workflows/push-wasm-images.yaml b/.github/workflows/push-wasm-images.yaml index c7e024c6..0c02c1bc 100644 --- a/.github/workflows/push-wasm-images.yaml +++ b/.github/workflows/push-wasm-images.yaml @@ -4,7 +4,7 @@ on: branches: - main env: - TINYGO_VERSION: 0.31.2 + TINYGO_VERSION: 0.32.0 jobs: build-and-push-wasm-images: @@ -32,7 +32,7 @@ jobs: with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GHCR_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build/Push Docker images run: make wasm_image.build_push diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index aa770587..c4ebfea1 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -8,7 +8,7 @@ on: - main env: - TINYGO_VERSION: 0.31.2 + TINYGO_VERSION: 0.32.0 jobs: style: diff --git a/README.md b/README.md index 1f75d5f5..e6d00e24 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This SDK is powered by [TinyGo](https://tinygo.org/) and does not support the of ## Requirements -- [TinyGo](https://tinygo.org/) - This SDK depends on TinyGo and leverages its [WASI](https://github.com/WebAssembly/WASI) (WebAssembly System Interface) target. Please follow the official instruction [here](https://tinygo.org/getting-started/) for installing TinyGo. +- [TinyGo](https://tinygo.org/): v0.32+ - This SDK depends on TinyGo and leverages its [WASI](https://github.com/WebAssembly/WASI) (WebAssembly System Interface) target. Please follow the official instruction [here](https://tinygo.org/getting-started/) for installing TinyGo. - [Envoy](https://www.envoyproxy.io) - To run compiled examples, you need to have Envoy binary. We recommend using [func-e](https://func-e.io) as the easiest way to get started with Envoy. Alternatively, you can follow [the official instruction](https://www.envoyproxy.io/docs/envoy/latest/start/install). diff --git a/proxywasm/internal/hostcall_utils_go.go b/proxywasm/internal/hostcall_utils.go similarity index 98% rename from proxywasm/internal/hostcall_utils_go.go rename to proxywasm/internal/hostcall_utils.go index 8d2c48a1..f9cd4d29 100644 --- a/proxywasm/internal/hostcall_utils_go.go +++ b/proxywasm/internal/hostcall_utils.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !tinygo - // Since the difference of the types in SliceHeader.{Len, Cap} between tinygo and go, // we have to have separated functions for converting bytes // https://github.com/tinygo-org/tinygo/issues/1284 diff --git a/proxywasm/internal/hostcall_utils_tinygo.go b/proxywasm/internal/hostcall_utils_tinygo.go deleted file mode 100644 index b3b8fd96..00000000 --- a/proxywasm/internal/hostcall_utils_tinygo.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020-2024 Tetrate -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build tinygo - -// Since the difference of the types in SliceHeader.{Len, Cap} between tinygo and go, -// we have to have separated functions for converting bytes -// https://github.com/tinygo-org/tinygo/issues/1284 - -package internal - -import ( - "reflect" - "unsafe" -) - -func RawBytePtrToString(raw *byte, size int) string { - return *(*string)(unsafe.Pointer(&reflect.SliceHeader{ - Data: uintptr(unsafe.Pointer(raw)), - Len: uintptr(size), - Cap: uintptr(size), - })) -} - -func RawBytePtrToByteSlice(raw *byte, size int) []byte { - return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ - Data: uintptr(unsafe.Pointer(raw)), - Len: uintptr(size), - Cap: uintptr(size), - })) -}