diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2c673e2ce6..34e9f79d02 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ on: pull_request: env: GO_VERSION: "1.18" - TINYGO_VERSION: "0.23.0" + TINYGO_VERSION: "0.24.0" jobs: test: name: Test diff --git a/pkg/module/module.go b/pkg/module/module.go index cd7e7d0c3e..fdfc723a72 100644 --- a/pkg/module/module.go +++ b/pkg/module/module.go @@ -84,8 +84,15 @@ type Manager struct { func NewManager(ctx context.Context) (*Manager, error) { m := &Manager{} + // The runtime must enable the following features because Tinygo uses these features to build. + // cf. https://github.com/tinygo-org/tinygo/blob/b65447c7d567eea495805656f45472cc3c483e03/targets/wasi.json#L4 + c := wazero.NewRuntimeConfig(). + WithFeatureBulkMemoryOperations(true). + WithFeatureNonTrappingFloatToIntConversion(true). + WithFeatureSignExtensionOps(true) + // Create a new WebAssembly Runtime. - m.runtime = wazero.NewRuntime() + m.runtime = wazero.NewRuntimeWithConfig(c) // Load WASM modules in local if err := m.loadModules(ctx); err != nil {