Skip to content

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Dec 11, 2025

Summary

Implements version bundle system for pre-validated, tested tool version combinations (#254).

What's New

checksums/toolchain_bundles.json - Bundle Definitions

Three initial bundles with December 2025 stable versions:

Bundle Tools Use Case
stable-2025-12 All 10 tools Full multi-language development
minimal wasm-tools, wit-bindgen, wasmtime Rust-only component builds
composition wasm-tools, wit-bindgen, wac, wkg, wasmtime Component composition workflows

Each bundle includes:

  • Tool versions - Pinned, tested versions
  • Compatibility info - Component model version (0x1000d), WASI version (preview2)
  • Tested platforms - darwin_arm64, darwin_amd64, linux_amd64, linux_arm64, windows_amd64
  • Version constraints - Documented tool interdependencies

toolchains/bundle.bzl - Bundle API

load("//toolchains:bundle.bzl", "bundle_api")

# Get bundle info
bundle = bundle_api.get_bundle(ctx, "stable-2025-12")
version = bundle_api.get_bundle_tool_version(ctx, "stable-2025-12", "wasm-tools")

# Validate bundle
is_valid, error = bundle_api.validate_bundle(ctx, "stable-2025-12")

# Resolve versions with overrides
versions = bundle_api.resolve_tool_versions(ctx, "stable-2025-12", {"wasm-tools": "1.244.0"})

# Diagnostics
print(bundle_api.print_bundle_info(ctx, "stable-2025-12"))

toolchains/extensions.bzl - Module Extension Tag

# MODULE.bazel (future use)
wasm_tool_repositories = use_extension("//toolchains:extensions.bzl", "wasm_tool_repositories")
wasm_tool_repositories.configure(bundle = "stable-2025-12")

Benefits

  • Guaranteed compatibility - No more version mismatch issues
  • Atomic upgrades - Switch bundle, all tools update together
  • Clear configurations - Named bundles instead of version soup
  • Validation at setup time - Catch issues early

Testing

  • Verified JSON syntax with Python
  • Build test passed: bazel build //test/cpp_binary:hello_cpp
  • Toolchain setup logs show bundle infrastructure loaded successfully

Future Work

  • Wire bundle versions into git_repository tags
  • Add bundle validation to CI
  • Create bundle update automation

Closes #254

Adds version bundle system for pre-validated, tested tool version combinations:

- checksums/toolchain_bundles.json: Bundle definitions with 3 initial bundles:
  - stable-2025-12: Full toolchain with all 10 tools for all languages
  - minimal: wasm-tools, wit-bindgen, wasmtime for Rust-only builds
  - composition: Adds wac, wkg for component composition workflows

- toolchains/bundle.bzl: Bundle API for reading/validating bundles:
  - get_bundle(), get_bundle_tool_version()
  - validate_bundle(), resolve_tool_versions()
  - print_bundle_info() for diagnostics

- toolchains/extensions.bzl: Module extension tag for bundle configuration:
  - wasm_tool_repositories.configure(bundle = "stable-2025-12")

Each bundle includes:
- Tested tool versions with compatibility guarantees
- Component model version (0x1000d) and WASI version (preview2)
- Tested platform list
- Version constraints documenting tool interdependencies

Closes #254
This commit completes the Option B (Full Integration) architecture for
toolchain version bundles:

Changes:
- Add get_version_for_tool() and log_bundle_usage() helpers to bundle.bzl
- Add 'bundle' attribute to all 8 toolchain repository rules:
  - wasm_toolchain_repository (wasm-tools, wac, wit-bindgen)
  - wasmtime_repository
  - wizer_toolchain_repository
  - wkg_toolchain_repository
  - tinygo_toolchain_repository
  - wasi_sdk_repository
  - cpp_component_toolchain_repository
  - jco_toolchain_repository
- Add unified wasm_component_bundle extension to wasm/extensions.bzl
  that configures all toolchains from a single bundle parameter

Architecture:
  MODULE.bazel
      │ wasm_component_bundle.configure(bundle = "stable-2025-12")
      ▼
  Module Extension (wasm/extensions.bzl)
      │ Pass bundle to each toolchain repo rule
      ▼
  Repository Rules (each toolchain)
      │ Read checksums/toolchain_bundles.json via Label path
      │ Extract version for this tool from bundle
      ▼
  Downloaded Tools (with compatible versions)

Each repository rule:
1. Accepts optional 'bundle' attribute
2. If bundle set, reads version from toolchain_bundles.json
3. Falls back to explicit version attribute if not in bundle
4. Logs bundle usage for debugging

This ensures all tools are downloaded with compatible, pre-validated
versions when using a bundle, eliminating version mismatch issues.

Part of #254: Toolchain Version Bundles for Guaranteed Compatibility
@avrabe avrabe merged commit f7def45 into main Dec 13, 2025
25 checks passed
@avrabe avrabe deleted the feature/254-toolchain-version-bundles branch December 13, 2025 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Toolchain Version Bundles for Guaranteed Compatibility

2 participants