diff --git a/testing/wazero/APKBUILD b/testing/wazero/APKBUILD new file mode 100644 index 00000000000..75542d1a0b3 --- /dev/null +++ b/testing/wazero/APKBUILD @@ -0,0 +1,37 @@ +# Maintainer: Jason Staten +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 +" diff --git a/testing/wazero/debug-test-path.patch b/testing/wazero/debug-test-path.patch new file mode 100644 index 00000000000..324291a24a8 --- /dev/null +++ b/testing/wazero/debug-test-path.patch @@ -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. +