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
-
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
-
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)
Summary
Consolidate scattered toolchain download logic into a single unified tool registry system.
Current State
.bzlfile has its own download logicProposed Solution
Single API for all tool downloads:
Key Changes
Central
tool_registry.bzlmodule that:checksums/tools/*.jsonat repository rule timeRefactor existing toolchains to use registry API
Benefits
New Features Enabled
bazel run @rules_wasm_component//tools:update_checksums- auto-fetch latest versionsImpact
Related
checksums/tools/*.jsoninfrastructure