feat: migrate wasm_optimize to native loom toolchain v1.1.14 (#512) - #514
Merged
Conversation
loom v1.x ships native per-OS binaries (no loom.wasm). Add a hermetic loom
toolchain, mirroring meld_toolchain.bzl but extracting the tarball (meld ships a
bare binary):
- toolchains/loom_toolchain.bzl: loom_repository (download+extract loom-v{ver}-
{triple}.tar.gz, expose the loom binary; stub for unsupported/Windows hosts)
+ loom_toolchain rule -> ToolchainInfo(loom=...).
- toolchains/BUILD.bazel: loom_toolchain_type + bzl_library.
- toolchains/tool_registry.bzl: _URL_PATTERNS["loom"] (tarball; strip_prefix ""
and binary "loom" via the existing defaults).
- wasm/extensions.bzl + MODULE.bazel: register @loom_toolchain (v1.1.14).
Registered but not yet consumed — wasm_optimize still uses the @loom_wasm 0.3.0
component; the rewire to the native toolchain is the next step (#512). Windows
loom (loom.exe) stubbed for now (follow-up).
Verified: `bazel build @loom_toolchain//:loom` fetches + extracts loom 1.1.14
for the host and resolves the binary.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rapper (#512) Rewire wasm_optimize to the native loom toolchain (added in the previous commit) instead of running the loom.wasm component under wasmtime: - executable = ctx.toolchains[loom_toolchain_type].loom; args `optimize <input> -o <output> [flags]` (loom CLI unchanged). Native loom reads the input directly through the OS, so the wasmtime/WASI-preopen/symlink workaround (#490, loom_wrapper) and the wasmtime toolchain dep are no longer needed and are removed from the rule. - Drop the @loom_wasm 0.3.0 wasm_component_download from MODULE.bazel. - Add //test/p3:loom_optimize_build_test (wasm_optimize on the P2 component) for coverage. Verified locally: //test/p3:hello_p2_optimized builds — native loom 1.1.14 optimizes the component (4/4 core modules, "Optimization complete"). (tools/loom_wrapper is now unused by loom; left in place — wasmsign2 patterns may still reference the approach — removable in a cleanup follow-up.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 18, 2026
avrabe
added a commit
that referenced
this pull request
Jun 18, 2026
#530) The updater still had loom as UniversalWasm{loom.wasm} + AssetExists, which kept it pinned at v0.3.0 — the last release shipping loom.wasm. #514 migrated the registry + toolchain to native per-platform binaries (loom-v{version}-{triple}.tar.gz, .zip on Windows), so the auto-updater could no longer advance loom past 0.3.0. loom's toolchain reads the registry url_suffix as the FULL versioned filename (tool_registry.bzl loom: `filename: "{suffix}"`, like wkg/wrpc). The existing PerPlatformAsset can't express that — its stored suffix is static, with no {version} — so it would write a stale filename on the next loom release. Add a PerPlatformVersionedAsset pattern whose resolved filename (with {version} and {platform}) is both the download asset and the verbatim url_suffix, so the two can never drift. Thread `version` into get_url_suffix (single caller) and re-point loom to the new pattern with VersionFilter::Any (GitHub /releases/latest correctly returns v1.1.14). Verified: `update --tools loom --force` selects v1.1.14, downloads all 4 native tarballs from the correct URLs, and reproduces the hand-authored #513 registry block (url_suffix + sha256) byte-for-byte — zero functional diff, proving the updater output matches what the loom toolchain consumes. New unit test test_per_platform_versioned_asset_loom_native asserts the exact strings; full lib suite 24/24 pass. No registry change needed (loom already at 1.1.14); this only lets future loom releases be picked up automatically. With this, every PulseEngine tool the updater tracks is auto-managed (remaining exclusion: `go`, null github_repo — separate mechanism). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes #512 (native-loom migration; builds on the merged #513 registry entry). loom v1.x is native-only (no
loom.wasm), shipping signed per-OS binaries with the loom#172/#196/#220 correctness fixes.Native loom toolchain:
toolchains/loom_toolchain.bzl—loom_repository(download + extract the tarball, expose theloombinary; stub for unsupported/Windows hosts) +loom_toolchain→ToolchainInfo. Mirrorsmeld_toolchain.bzl(meld is a bare binary; loom is a tarball).loom_toolchain_type+bzl_library+tool_registryURL pattern;@loom_toolchainregistered in MODULE.bazel (v1.1.14).wasm_optimize rewire:
ctx.toolchains[loom_toolchain_type].loom,loom optimize <input> -o <output> …). Native loom reads inputs through the OS, so the wasmtime/WASI-preopen/symlink workaround (wasm_optimize: LoomOptimize action cannot find a fetched/symlinked input (wasmtime --dir=. preopen) #490,loom_wrapper) and the wasmtime toolchain dep are removed from the rule.@loom_wasm0.3.0 component download.//test/p3:loom_optimize_build_testadded for coverage.Verification (local)
bazel build @loom_toolchain//:loom— fetches + extracts loom 1.1.14.bazel build //test/p3:hello_p2_optimized— native loom optimizes a real component (4/4 core modules, "Optimization complete").meld → loom → synthfused falcon path needs @avrabe's//:falcon-optimizede2e — please verify against this branch (it should also let jess drop thedead-storesoverride per the issue).Notes
loom.exe) is stubbed (follow-up).tools/loom_wrapperis now unused by loom; left in place, removable in cleanup.🤖 Generated with Claude Code