mirror of
https://github.com/alibaba/higress.git
synced 2026-06-06 11:17:29 +08:00
Migrate WASM Go Plugins to New SDK and Go 1.24 (#2532)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
PLUGIN_NAME ?= hello-world
|
||||
BUILDER_REGISTRY ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/
|
||||
REGISTRY ?= higress-registry.cn-hangzhou.cr.aliyuncs.com/plugins/
|
||||
GO_VERSION ?= 1.20.14
|
||||
GO_VERSION ?= 1.24.0
|
||||
TINYGO_VERSION ?= 0.29.0
|
||||
ORAS_VERSION ?= 1.0.0
|
||||
HIGRESS_VERSION ?= 1.0.0-rc
|
||||
USE_HIGRESS_TINYGO ?= false
|
||||
BUILDER ?= ${BUILDER_REGISTRY}wasm-go-builder:go${GO_VERSION}-tinygo${TINYGO_VERSION}-oras${ORAS_VERSION}
|
||||
BUILDER ?= ${BUILDER_REGISTRY}wasm-go-builder:go${GO_VERSION}-oras${ORAS_VERSION}
|
||||
BUILD_TIME := $(shell date "+%Y%m%d-%H%M%S")
|
||||
COMMIT_ID := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
IMAGE_TAG = $(if $(strip $(PLUGIN_VERSION)),${PLUGIN_VERSION},${BUILD_TIME}-${COMMIT_ID})
|
||||
@@ -64,9 +64,8 @@ builder:
|
||||
@echo "image: ${BUILDER}"
|
||||
|
||||
local-build:
|
||||
tinygo build -scheduler=none -target=wasi -gc=custom -tags='custommalloc nottinygc_finalizer' \
|
||||
-o extensions/${PLUGIN_NAME}/main.wasm \
|
||||
extensions/${PLUGIN_NAME}/main.go
|
||||
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o extensions/${PLUGIN_NAME}/main.wasm extensions/${PLUGIN_NAME}/main.go
|
||||
|
||||
@echo ""
|
||||
@echo "wasm: extensions/${PLUGIN_NAME}/main.wasm"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user