fix: enable some features of the wasm runtime (#2575)

This commit is contained in:
saso
2022-07-24 14:31:54 +09:00
committed by GitHub
parent 84677903a6
commit 7b4f2dc72f
2 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -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 {