testing/wazero: new aport

https://github.com/tetratelabs/wazero

wazero is a WebAssembly Core Specification 1.0 and 2.0 compliant runtime
This commit is contained in:
Jason Staten 2023-12-18 22:03:02 -07:00 committed by ptrcnull
parent 4fceee049e
commit 180b9737a9
No known key found for this signature in database
GPG Key ID: 411F7B30801DD9CA
2 changed files with 51 additions and 0 deletions

37
testing/wazero/APKBUILD Normal file
View File

@ -0,0 +1,37 @@
# Maintainer: Jason Staten <code.alpine@jxs.me>
pkgname=wazero
pkgver=1.5.0
pkgrel=0
pkgdesc="WebAssembly Core Specification 1.0 and 2.0 compliant runtime"
url="https://wazero.io"
# Tests fail on 32-bit and ppc64le architectures
arch="x86_64 aarch64"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/tetratelabs/wazero/archive/refs/tags/v$pkgver.tar.gz
debug-test-path.patch
"
build() {
go build \
-ldflags "-X github.com/tetratelabs/wazero/internal/version.version=$pkgver" \
./cmd/wazero
}
check() {
# gojs/goos -buildmode=pie not supported on js/wasm
export GOFLAGS="${GOFLAGS/-buildmode=pie}"
# integration_test/vs/compiler requires real paths for relative read
export GOFLAGS="${GOFLAGS/-trimpath}"
go test github.com/tetratelabs/wazero/internal/...
}
package() {
install -Dm755 wazero -t "$pkgdir"/usr/bin
}
sha512sums="
137c73e6a31c3688c81f1edebc44b73722557738a99909c0f51cc99a63497492349f31d08e05a36372e077205f0631bc6ce1e33e444485bd52a9f3a0a9175592 wazero-1.5.0.tar.gz
289e501d3604c7b4a2907d6b93c7ee93751c3d8dfe0565ec1bf9d275734cd973d03713056405d0adaa7a762a5748f47664fd24b900540ff5b9383fe54a72ac88 debug-test-path.patch
"

View File

@ -0,0 +1,14 @@
diff --git a/debug_test.go b/debug_test.go
index 1747423..26921d5 100644
--- a/internal/wasmdebug/debug_test.go
+++ b/internal/wasmdebug/debug_test.go
@@ -144,7 +144,7 @@ wasm stack trace:
x.y()`)
require.Contains(t, errStr, "Go runtime stack trace:")
require.Contains(t, errStr, "goroutine ")
- require.Contains(t, errStr, "wazero/internal/wasmdebug/debug_test.go")
+ require.Contains(t, errStr, "internal/wasmdebug/debug_test.go")
}
// compile-time check to ensure testRuntimeErr implements runtime.Error.