Skip to content

feat: enforce WASI reactor mode #859

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

Merged
merged 4 commits into from
May 27, 2025

Conversation

mattjohnsonpint
Copy link
Member

@mattjohnsonpint mattjohnsonpint commented May 27, 2025

All Modus apps are technically implemented as WASI "reactor" modules - which should use _initialize as their internal wasm start function. _start should be used only for WASI "command" modules.

This PR updates Modus to enforce this part of the WASI spec. As a side effect, the minimum version of TinyGo for the Modus Go SDK is now increased to v0.35.0.

@Copilot Copilot AI review requested due to automatic review settings May 27, 2025 17:04
@mattjohnsonpint mattjohnsonpint requested a review from a team as a code owner May 27, 2025 17:04
Copy link

linear bot commented May 27, 2025

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enforces the use of the WASI reactor module mode by switching the start function from _start to _initialize and updating the required TinyGo version.

  • Bump the minimum TinyGo version from 0.33.0 to 0.35.0 across the build system and CLI globals.
  • Remove the TinyGo version check in the build process and unconditionally use reactor mode flags.
  • Update module configuration and plugin setup to dynamically select the proper WASI startup function based on module exports.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sdk/go/tools/modus-go-build/compiler/compiler.go Updates version constant and removes conditional TinyGo version check to enforce reactor mode.
sdk/assemblyscript/src/plugin.asconfig.json Changes the exported start function from _start to _initialize.
runtime/wasmhost/wasmhost.go Adapts getModuleConfig usage to include the plugin information and update start functions.
runtime/plugins/plugins.go Introduces a StartFunction field and conditionally selects the appropriate start function.
cli/src/custom/globals.ts Updates the minimum TinyGo version in CLI globals.
CHANGELOG.md Adds an entry for the new WASI reactor mode enforcement feature.
Comments suppressed due to low confidence (1)

sdk/go/tools/modus-go-build/compiler/compiler.go:27

  • The TinyGo version check is removed; consider removing the getCompilerVersion helper and its associated error handling to simplify the build process.
tinygoVersion, err := getCompilerVersion(config)

Copy link

trunk-io bot commented May 27, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

@mattjohnsonpint mattjohnsonpint enabled auto-merge (squash) May 27, 2025 17:07
@mattjohnsonpint mattjohnsonpint merged commit e4f2973 into main May 27, 2025
88 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-3420-enforce-wasi-reactor-mode branch May 27, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants