You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the structs used for serialization in the Module feature are defined under pkg/module/serialize. These structs are compiled with TinyGo for use in Wasm. However, this package imports the pkg/types package, which often causes TinyGo builds to fail. This is primarily because the type package imports third-party modules that use packages not supported by TinyGo. For example, simply refactoring the types package can suddenly cause TinyGo builds to fail. In the above case, the failure was caused by this issue, but similar problems have occurred multiple times in the past.
Proposal
Ideally, the same structs should be used on both the host and Wasm sides. Otherwise, using different structs for marshaling and unmarshaling can lead to potential failures. However, since the Module feature is still experimental and it is not desirable to spend significant time dealing with TinyGo errors, I propose redefining the structs used on the Wasm side in pkg/module/serialize and removing the import of Trivy's types package. This way, changes to the types package will not affect the Wasm side.
The text was updated successfully, but these errors were encountered:
Background
Currently, the structs used for serialization in the Module feature are defined under pkg/module/serialize. These structs are compiled with TinyGo for use in Wasm. However, this package imports the pkg/types package, which often causes TinyGo builds to fail. This is primarily because the type package imports third-party modules that use packages not supported by TinyGo. For example, simply refactoring the types package can suddenly cause TinyGo builds to fail. In the above case, the failure was caused by this issue, but similar problems have occurred multiple times in the past.
Proposal
Ideally, the same structs should be used on both the host and Wasm sides. Otherwise, using different structs for marshaling and unmarshaling can lead to potential failures. However, since the Module feature is still experimental and it is not desirable to spend significant time dealing with TinyGo errors, I propose redefining the structs used on the Wasm side in pkg/module/serialize and removing the import of Trivy's types package. This way, changes to the types package will not affect the Wasm side.
The text was updated successfully, but these errors were encountered: