Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mattjohnsonpint
Copy link
Contributor

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

@mattjohnsonpint mattjohnsonpint requested review from a team and Copilot May 27, 2025 17:04
@linear
Copy link

linear bot commented May 27, 2025

Copy link
Contributor

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)

@trunk-io
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants