-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: replace TinyGo with standard Go for WebAssembly modules #8496
Open
knqyf263
wants to merge
10
commits into
aquasecurity:main
Choose a base branch
from
knqyf263:go_wasm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Update module documentation to reflect Go support instead of TinyGo - Modify build commands to use standard Go for WebAssembly compilation - Remove TinyGo-specific code and comments - Update WASM SDK to work with standard Go - Remove TinyGo-specific UUID implementation - Update build scripts and example modules to use Go build
- Add explicit memory management for WASM module function calls - Implement deferred pointer freeing for dynamically allocated memory - Add comments explaining memory allocation and freeing responsibilities - Refactor module functions to consistently handle memory allocation - Improve error handling and resource management in WASM module interactions
- Move artifact type constants from `artifact` package to `fanal/types` - Update all references to use `ftypes.ArtifactType` instead of `artifact.Type` - Remove redundant type definition in `artifact` package - Ensure consistent usage of artifact type across the project - Improve type safety and reduce package dependencies
- Replace custom serialization types with standard `types.Results` - Update module interfaces to use `types.Results` instead of `serialize.Results` - Remove redundant type definitions in `serialize` package - Simplify type imports and reduce package complexity - Improve compatibility with standard Go WebAssembly modules
- Replace `serialize.CustomResource` with `ftypes.CustomResource` - Update Spring4Shell module to use `ftypes.CustomResource` - Remove redundant type definition in `serialize` package - Improve type consistency across module and fanal packages
- Clean up unnecessary dependencies in go.mod and go.sum - Remove tools and packages no longer used in the project - Simplify dependency management by removing redundant entries - Reduce project complexity and potential version conflicts
- Replace `serialize.Results` with `types.Results` in module test files - Update import statements to use `types.Results` - Maintain consistency with previous type migration efforts - Simplify type imports for module test data
knqyf263
commented
Mar 6, 2025
@@ -86,23 +86,10 @@ type Artifact interface { | |||
Clean(reference Reference) error | |||
} | |||
|
|||
// Type represents a type of artifact | |||
type Type string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
artifact
package imports many other modules, which cannot be compiled to Wasm. I moved this type to fanal/types
so Wasm modules will not import artifact
.
- Ensure proper database connection closure after test - Use `t.Cleanup()` to automatically close database connection - Improve test resource management and prevent potential resource leaks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Go 1.24 improved Wasm support. We can directly compile Go code into Wasm modules without TinyGo.
https://go.dev/blog/wasmexport
Related PRs
Checklist