Skip to content

feat: Unified Tool Registry & Download System #249

@avrabe

Description

@avrabe

Summary

Consolidate scattered toolchain download logic into a single unified tool registry system.

Current State

  • Each toolchain .bzl file has its own download logic
  • Platform detection duplicated across files
  • Version management scattered
  • ~500 lines of duplicate download code

Proposed Solution

Single API for all tool downloads:

tool_registry.download(ctx, "wasm-tools", "1.240.0", platform)

Key Changes

  1. Central tool_registry.bzl module that:

    • Reads all checksums/tools/*.json at repository rule time
    • Provides unified download API
    • Handles platform detection ONCE, reuses everywhere
    • Central cache management
    • Automatic version resolution with "latest" support
  2. Refactor existing toolchains to use registry API

Benefits

  • DRY: Remove ~500 lines of duplicate download code
  • Single point for security auditing
  • Easier version bumps (one JSON file per tool)
  • Consistent error handling

New Features Enabled

  • bazel run @rules_wasm_component//tools:update_checksums - auto-fetch latest versions
  • Version compatibility matrix validation
  • Offline mode with pre-populated cache

Impact

  • Effort: Low
  • Risk: Low
  • Value: Medium

Related

  • Builds on existing checksums/tools/*.json infrastructure
  • Foundation for Version Bundles (#TBD)

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