Skip to content

🛠️ Create Bazel toolchain for component selection and integration #4

@avrabe

Description

@avrabe

Overview

Create Bazel rules and toolchain infrastructure for selecting between TinyGo and Rust implementations with security configuration.

Tasks

  • Create file_ops_toolchain rule definition
  • Implement component selection logic (auto/tinygo/rust)
  • Add security level configuration (standard/high/strict)
  • Create file_ops_action rule for easy integration
  • Implement wasmtime integration with preopen directories
  • Add backward compatibility layer for JSON configs
  • Create comprehensive examples and documentation
  • Add integration helpers for common patterns

Key Rules to Create

  • file_ops_toolchain: Toolchain configuration
  • file_ops_action: Main user-facing rule
  • file_ops_component_library: For embedding components
  • Helper functions for workspace preparation

Selection Logic

file_ops_action(
    implementation = "auto",  # auto, tinygo, rust
    security_level = "high",   # standard, high, strict  
    operations = [...],
    preopen_dirs = [...],
)

Security Integration

  • Configure wasmtime preopen directories
  • Implement path validation at rule level
  • Add security policy enforcement
  • Create audit logging for operations

Acceptance Criteria

  • Users can easily select implementation (auto/manual)
  • Security levels properly configure sandbox restrictions
  • Backward compatibility with existing JSON workflows
  • Integration works seamlessly with rules_wasm_component
  • Examples demonstrate all major use cases
  • Performance overhead is minimal
  • Error messages are clear and actionable

Related

Part of Phase 4 toolchain integration. Depends on both TinyGo (#2) and Rust (#3) implementations.

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