Skip to content

Fix Go component WIT dependency resolution issues #17

@avrabe

Description

@avrabe

Problem

Go component examples fail during WIT markdown documentation generation due to missing WASI dependencies.

Error

Error: failed to resolve directory while parsing WIT for path [bazel-out/k8-fastbuild/bin/examples/go_component/calculator_wit_wit]

Caused by:
    package 'wasi:io@0.2.0' not found. known packages:
        example:calculator@1.0.0
    
         --> calculator.wit:40:12
          |
       40 |     import wasi:io/streams@0.2.0;
          |            ^------

Root Cause

The Go component WIT files import WASI interfaces but the WIT dependency resolution isn't configured properly:

  • Missing WASI package dependencies in WIT resolution
  • wit-bindgen markdown command can't find required WASI interfaces
  • Affects documentation generation for Go components

Current Workaround

Excluded //examples/go_component/... from CI builds, but the exclusion might not be working properly due to dependency chains.

Proposed Solution

  1. Add proper WASI dependencies to Go component WIT files
  2. Configure wit-bindgen with correct WASI package paths
  3. Review wit_library rule configuration for proper dependency handling
  4. Ensure WASI interfaces are available during documentation generation

Impact

  • Go component examples can't generate documentation
  • Affects all Go components that use WASI interfaces
  • Core functionality works but documentation generation fails

Priority

Medium - affects documentation and examples but not core functionality

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions