From 1d998f56dcd5b2e3b05f11202e26d7a0d4c04c90 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Thu, 6 Aug 2026 08:58:00 -0400 Subject: [PATCH 1/3] Point componentize-js references at the lann/componentize-js fork --- .github/workflows/componentize-js-toolchain.yml | 2 +- examples/componentize-demo/README.md | 2 +- js/componentize/README.md | 4 ++-- js/componentize/webcrypto.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/componentize-js-toolchain.yml b/.github/workflows/componentize-js-toolchain.yml index 82ce4e3..128b648 100644 --- a/.github/workflows/componentize-js-toolchain.yml +++ b/.github/workflows/componentize-js-toolchain.yml @@ -86,7 +86,7 @@ jobs: curl -fsSLO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-30/wasi-sdk-30.0-${{ matrix.wasi-sdk }}.tar.gz tar -C "$RUNNER_TEMP" -xf wasi-sdk-30.0-${{ matrix.wasi-sdk }}.tar.gz export WASI_SDK_PATH="$RUNNER_TEMP/wasi-sdk-30.0-${{ matrix.wasi-sdk }}" - git clone https://github.com/dicej/componentize-js "$RUNNER_TEMP/componentize-js" + git clone https://github.com/lann/componentize-js "$RUNNER_TEMP/componentize-js" git -C "$RUNNER_TEMP/componentize-js" checkout "${{ steps.id.outputs.rev }}" # componentize-js's build.rs builds its wasm runtime by spawning a # nested `cargo build --target=wasm32-wasip2` after removing every diff --git a/examples/componentize-demo/README.md b/examples/componentize-demo/README.md index fa95ad5..00a13f1 100644 --- a/examples/componentize-demo/README.md +++ b/examples/componentize-demo/README.md @@ -7,7 +7,7 @@ end to end: HMAC-SHA-256 known answers (RFC 4231), AES-256-GCM known answers (NIST GCM test case 16), round trips including the empty plaintext, and the key-capability surface (usages, extractability, malformed-input rejection). -[componentize-js]: https://github.com/dicej/componentize-js +[componentize-js]: https://github.com/lann/componentize-js The guest exports the same `demo:webcrypto-demo/demo@0.1.0` entry point as the Rust `crypto-demo` guest, so the existing `crypto-demo-driver` drives it diff --git a/js/componentize/README.md b/js/componentize/README.md index 9453d05..9229ceb 100644 --- a/js/componentize/README.md +++ b/js/componentize/README.md @@ -7,7 +7,7 @@ the `polymorph:webcrypto` interfaces. This is the JS-guest counterpart of the Ru ergonomic Rust newtypes, `webcrypto.js` wraps them in the API JS code already knows — `crypto.subtle`. -[componentize-js]: https://github.com/dicej/componentize-js +[componentize-js]: https://github.com/lann/componentize-js ## Surface @@ -96,7 +96,7 @@ To use a build of your own instead — a platform with no published asset, or a revision you are evaluating — put it on `COMPONENTIZE_JS`: ```sh -git clone https://github.com/dicej/componentize-js +git clone https://github.com/lann/componentize-js cd componentize-js git checkout "$(cat path/to/js/componentize/componentize-js.rev)" # Needs WASI-SDK 30 on WASI_SDK_PATH; see that repository's README. diff --git a/js/componentize/webcrypto.js b/js/componentize/webcrypto.js index e49f685..31a0b5b 100644 --- a/js/componentize/webcrypto.js +++ b/js/componentize/webcrypto.js @@ -1,6 +1,6 @@ // @ts-check // A WebCrypto-subset library for JS guests componentized with -// componentize-js (https://github.com/dicej/componentize-js, the wit-dylib +// componentize-js (https://github.com/lann/componentize-js, the wit-dylib // reboot of ComponentizeJS), backed by the `polymorph:webcrypto` interfaces. // // The surface mirrors `crypto.subtle` for the supported algorithms: From 553a818b721d594c943615665b001dffd97dcc51 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Thu, 6 Aug 2026 09:09:26 -0400 Subject: [PATCH 2/3] Bump componentize-js to the eager-settlement fix (lann/componentize-js#1) --- js/componentize/README.md | 12 +++++++----- js/componentize/componentize-js.rev | 2 +- js/componentize/webcrypto.js | 16 +++++++++------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/js/componentize/README.md b/js/componentize/README.md index 9229ceb..deea5f4 100644 --- a/js/componentize/README.md +++ b/js/componentize/README.md @@ -104,8 +104,10 @@ cargo install --path . export COMPONENTIZE_JS="$(command -v componentize-js)" ``` -One further upstream quirk needs no action: an async import that completes -*without* suspending resolves with the raw canonical `result` wrapper -(`{ tag, val }`) instead of the unwrapped value. The library normalizes both -settlement shapes internally (see `callImport` in `webcrypto.js`), so it -works unchanged whether or not that is fixed upstream. +The pin also includes the eager-settlement fix, +[lann/componentize-js#1](https://github.com/lann/componentize-js/pull/1): +revisions before it resolve an async import that completes *without* +suspending with the raw canonical `result` wrapper (`{ tag, val }`) instead +of the unwrapped value. The library normalizes both settlement shapes +internally (see `callImport` in `webcrypto.js`), so it runs unchanged on +revisions either side of that fix. diff --git a/js/componentize/componentize-js.rev b/js/componentize/componentize-js.rev index fcd1f88..df7e7ba 100644 --- a/js/componentize/componentize-js.rev +++ b/js/componentize/componentize-js.rev @@ -1 +1 @@ -bdd7c3d50e064d9c820218dbeb98be8bcae96875 +f417fa6d5f747a6fe8a956fcb7f18806bfa508fd diff --git a/js/componentize/webcrypto.js b/js/componentize/webcrypto.js index 31a0b5b..8508bb0 100644 --- a/js/componentize/webcrypto.js +++ b/js/componentize/webcrypto.js @@ -326,13 +326,15 @@ async function verdict(operation) { /** * Await an async `polymorph:webcrypto` import and normalize its settlement. * - * componentize-js (as of the revision pinned in componentize-js.rev) - * settles async imports through two paths: an import that suspends resolves - * with the `ok` value unwrapped and rejects an `err` as a `ComponentError`, - * but an import that completes without blocking resolves with the raw - * canonical `result` wrapper (`{ tag: "ok" | "err", val }`). Detecting the - * wrapper is unambiguous for this surface: every `ok` payload is a - * resource, typed array, or `undefined` — never a plain `{ tag }` object. + * componentize-js settles a suspending import with the `ok` value unwrapped + * and rejects an `err` as a `ComponentError`; revisions before the + * eager-settlement fix (lann/componentize-js#1, included in the pinned + * revision) settle an import that completes without blocking with the raw + * canonical `result` wrapper (`{ tag: "ok" | "err", val }`) instead. Both + * shapes are normalized here, so the library runs on revisions either side + * of that fix. Detecting the wrapper is unambiguous for this surface: every + * `ok` payload is a resource, typed array, or `undefined` — never a plain + * `{ tag }` object. * @param {unknown} promise * @returns {Promise} */ From 000f282e003f4d65f3177c7d5f8317422771a413 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Thu, 6 Aug 2026 09:27:49 -0400 Subject: [PATCH 3/3] Record the toolchain digests for f417fa6 --- js/componentize/componentize-js.sha256 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/componentize/componentize-js.sha256 b/js/componentize/componentize-js.sha256 index 31bba02..2101c41 100644 --- a/js/componentize/componentize-js.sha256 +++ b/js/componentize/componentize-js.sha256 @@ -15,5 +15,5 @@ # Regenerate with `just componentize::update-toolchain-digest` when the revision changes: # it verifies the attestation before recording, so adding a line here is the # deliberate, reviewable act of trusting a new binary. -linux-aarch64 043b3695a82fef4114454fa3e7195d8bfcaf704ac8e3880ba53e27526d2620ee e64592d1009bf7eed52d2d3efe33420c5c4c8d323bd9c3062db4fffe75cb713c -linux-x86_64 9a38c0a6b82f0bab9ac63cfc65d3a4218f65c96c68fe43998e0053762d1697cd 69b9b79f422abf26b0836a5ddd653ce751c433adf944d465b71f89cca31ff927 +linux-aarch64 f18dc2a472946fb531d6a6a64ca8e29d14c48027c6d719ccb5120c57e2d9eeb3 b5a7663d4893a239281408772c343f37e324ac778fbf9fc9b09368f52222580f +linux-x86_64 be573cd7631ccc10d3daa2c5b8b1ae99c3026e69e5fade0286287bcaed843963 ba88d9a02a04f15a0744eb6753944e7cf3b39a84eae4085f4654351c4687846c