WIT-enabled Go components temporarily excluded from CI
Opened this issue ยท 2 comments
Issue Description
Currently, WIT-enabled Go components are failing CI builds due to upstream TinyGo limitations with WIT dependency resolution.
Affected Targets
The following targets have been temporarily excluded from CI builds:
//examples/go_component:calculator_component//examples/go_component:calculator_simple//examples/go_component:calculator_with_bindings//examples/go_component:calculator_simple_binding
Root Cause
Upstream Issue: TinyGo Issue #80 - WIT dependency resolution not supported
Tracking PR: TinyGo PR #4934 - Adds WIT world dependency resolution support
Error Pattern
error: package 'wasi:io@0.2.0' not found. known packages:
example:calculator@1.0.0
--> wit/calculator.wit:40:12
|
40 | import wasi:io/streams@0.2.0;
| ^------
Resolution Plan
- โ Immediate: Exclude WIT-enabled Go targets from CI to maintain clean builds
- โณ Monitor: Track progress on TinyGo PR #4934
- ๐ Re-enable: Once upstream support lands, remove CI exclusions and test
Implementation
CI configuration updated in .github/workflows/ci.yml with clear comments indicating temporary exclusion status and tracking information.
Labels: upstream, tinygo, wit, ci
๐ Resolution Available - Custom WIT Worlds Already Supported!
Major Update (Oct 2025): The upstream blocker for this issue has been resolved - TinyGo already supports custom WIT worlds!
Root Cause Resolution
TinyGo PR #4934 (mentioned in original issue) was closed Oct 6, 2025 because the functionality already exists. The -wit-world flag overrides the default wasi:cli/command.
Next Steps to Re-enable CI
- Update
go_wasm_componentrule to properly pass-wit-worldparameter to TinyGo - Test affected targets:
//examples/go_component:calculator_component//examples/go_component:calculator_simple//examples/go_component:calculator_with_bindings//examples/go_component:calculator_simple_binding
- Validate component exports with
wasm-tools component wit - Re-enable in CI once validation passes
Implementation Pattern
tinygo build -target=wasip2 \
-wit-package=wit/calculator.wit \
-wit-world=calculator-world \
-o component.wasm main.goReferences
- TinyGo Issue #4843: Confirmation that custom worlds work
- Related Issue: #80 (same root cause, now resolved)
The WIT dependency resolution issue mentioned in the original error may still need investigation, but the core "hardcoded world" limitation is not a real blocker.
โ READY TO RE-ENABLE IN CI
Status: Code fixes complete, architecture clarified. Can re-enable after WIT dependency setup.
Fixes Applied
All fixes from issue #80 apply here:
- โ
TinyGo flag format corrected (
-wit-package,-wit-world) - โ WIT directory path handling fixed
- โ Absolute path resolution in wrapper script
Re-enabling CI Builds
Step 1: Update WIT files with minimal WASI imports
world calculator-world {
// TinyGo runtime requirement (even for reactor)
import wasi:io/streams@0.2.0;
export calculator;
}Step 2: Update wit_library with deps
wit_library(
name = "calculator_wit",
srcs = ["wit/calculator.wit"],
world = "calculator-world",
deps = [
"@wasi_io_v020//:streams",
],
)Step 3: Test targets individually
bazel build //examples/go_component:calculator_simpleStep 4: Re-enable in .github/workflows/ci.yml
Multi-Component Use Cases
For composition with Rust main + Go libraries, use WAC:
wac_compose_with_oci(
name = "app",
composition = """
let rust = new main:component { ... };
let go = new calculator:component { ... };
connect rust.calculator -> go;
export rust as main;
""",
local_components = {
"main": "//rust:cli",
"calculator": "//examples/go_component:calculator_reactor",
},
)See: examples/go_component/COMPOSITION_GUIDE.md for complete architecture guide.
Architecture Validation
TinyGo custom WIT worlds work correctly when:
- Use single-dash flags (
-wit-package,-wit-world) - Pass full WIT directory with deps
- Include minimal WASI imports for Go runtime
The original error (package 'wasi:io@0.2.0' not found) was a WIT dependency setup issue, not a TinyGo limitation.