Skip to content

WRPC implementation lacks testing and validationΒ #34

@avrabe

Description

@avrabe

Problem

The WRPC (WebAssembly Component RPC) implementation exists in the codebase but appears to be untested and potentially incomplete. While the rules are architecturally complete, there is no evidence of testing or working examples.

Current State

βœ… Implementation Exists

  • Rules implemented: wrpc_bindgen, wrpc_serve, wrpc_invoke in /wrpc/defs.bzl
  • Toolchain integration: WRPC binary build support in toolchains/wasm_toolchain.bzl
  • Documentation: Recently added to schema generation and rule reference

❌ Missing Testing & Validation

  • No test files containing "wrpc" anywhere in the project
  • No examples using WRPC in /examples/ directory
  • No integration tests for the WRPC functionality
  • Empty wrpc_commit in MODULE.bazel.lock suggests inactive configuration

πŸ”§ Implementation Details

WRPC Rules Structure:

  • wrpc_bindgen - Generates language bindings from WIT for RPC
  • wrpc_serve - Creates executable scripts to serve components as RPC servers
  • wrpc_invoke - Creates executable scripts to call remote component functions

Toolchain Integration:

  • WRPC binary built via cargo from git repository
  • Hybrid approach: git_repository + genrule for cargo build
  • Uses wrpc-wasmtime binary from the WRPC project

Recommended Actions

Before considering WRPC as production-ready, we should:

  1. Create Basic Example

    • Simple client-server WRPC example
    • Demonstrate wrpc_bindgen generating bindings
    • Show wrpc_serve and wrpc_invoke working together
  2. Test Rule Functionality

    • Verify wrpc_bindgen can generate valid bindings
    • Test wrpc_serve creates working server scripts
    • Validate wrpc_invoke can call remote functions
  3. Verify Toolchain Integration

    • Ensure WRPC binary builds correctly
    • Test toolchain detection and configuration
    • Validate hybrid git_repository + cargo approach
  4. Add Test Coverage

    • Unit tests for rule implementations
    • Integration tests for end-to-end WRPC workflows
    • CI validation of WRPC functionality

Impact

Currently, WRPC appears to be a proof-of-concept implementation rather than tested, production-ready functionality. This creates a risk of:

  • Documentation claiming support for features that don't work
  • Users encountering broken WRPC functionality
  • Maintenance burden for untested code

Files Involved

  • /wrpc/defs.bzl - Rule implementations
  • /wrpc/BUILD.bazel - Build configuration
  • /toolchains/BUILD.wrpc - WRPC binary build
  • /toolchains/wasm_toolchain.bzl - Toolchain integration
  • /tools/generate_schemas/comprehensive_schemas.go - Documentation generation

Acceptance Criteria

  • Working WRPC example in /examples/wrpc/
  • Integration tests for all WRPC rules
  • Verified toolchain builds WRPC binary correctly
  • CI includes WRPC testing
  • Documentation reflects actual tested capabilities

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttoolchainChanges to build toolchain configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions