mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
fix: enable some features of the wasm runtime (#2575)
This commit is contained in:
2
.github/workflows/test.yaml
vendored
2
.github/workflows/test.yaml
vendored
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user