From 06b93f6931ef4b2df4dbe2b2ceddf03feb5a6d76 Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Fri, 7 Aug 2026 00:45:54 -0400 Subject: [PATCH] Bump component-test to 76c0945; adopt the setup action and shared glue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pin moves via `component-test pins bump` (AGENTS.md's bump procedure now names it). Upstream absorption applied on top (polymorph-test#56/#57/#58): - CI: the ct-rev output step and the hand-rolled tools cache move into polymorph-test/actions/setup (stamp-compatible with _ct-tools, which stays untouched — it already had the stamp-and-skip shape); the aggregate ref grep guard is replaced by the actions' cargo-lock ref checks on both aggregate invocations. - The conformance jco tree's transpile scripts and the viewer-staging transpile call the component-test-jco-transpile bin; the runners drop their local suite.replaceAll normalization (envelope now owns the lockfile-identity rule). The other jco-transpile.mjs consumers (jco-demo, jco types, WPT parity) keep the in-repo wrapper until the #345 jco modernization touches those trees; the script stays until then. Verified: CONFORMANCE_BROWSER=1 conformance-ct::all green (4 targets, 76360 results + signing 2316, both committed matrices unchanged). --- .github/workflows/ci.yml | 46 ++++++--------------- AGENTS.md | 10 ++--- Cargo.lock | 14 +++---- Cargo.toml | 4 +- conformance/driver-ct/jco/package-lock.json | 11 +++-- conformance/driver-ct/jco/package.json | 6 +-- conformance/driver-ct/jco/run-browser.mjs | 2 +- conformance/driver-ct/jco/runner.mjs | 2 +- conformance/driver-ct/justfile | 2 +- 9 files changed, 40 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf80a0f..39d51f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,27 +97,14 @@ jobs: shared-key: conformance cache-all-crates: true - - name: Compute the component-test rev - # The single source of truth for the pin is Cargo.lock (the git - # dependency's rev); the tools cache below keys on it. Anchored - # on the crate name, not the repository URL, like the - # conformance-ct::_ct-tools extraction. - id: ct-rev - run: | - rev=$(grep -m1 -A2 '^name = "component-test-sdk"' Cargo.lock | grep -oE '[0-9a-f]{40}' | head -1) - test -n "$rev" - echo "rev=$rev" >> "$GITHUB_OUTPUT" - - - name: Cache component-test tools - # The cargo-installed component-test CLI + generic runner - # binaries (conformance-ct::_ct-tools installs them at exactly - # the Cargo.lock-pinned rev and reuses on a stamp match). The - # binaries are a pure function of that rev and the toolchain, so - # the key never needs invalidating beyond those. - uses: actions/cache@v4 + - name: Install the component-test tools at the pinned revision + # Owns the rev derivation, the rev-keyed tools cache, the + # install, and the pins gate; conformance-ct::_ct-tools + # recognizes the stamped install and does not repeat it. + uses: polymorph-components/polymorph-test/actions/setup@76c094576076284c1a7d0ea1b7bb724e9e7384a5 with: - path: target/ct-tools - key: component-test-tools-${{ runner.os }}-${{ steps.ct-rev.outputs.rev }}-${{ hashFiles('rust-toolchain.toml') }} + js-locks: | + conformance/driver-ct/jco/package-lock.json - name: Install Node 24 uses: actions/setup-node@v4 @@ -167,20 +154,11 @@ jobs: # gated the same aggregates; these re-run them through # component-test's composite action for the job summary and # finding annotations, with the prebuilt CLI so aggregation - # semantics cannot skew from the pin. `uses:` cannot interpolate, - # so the refs are literal revs; the guard keeps them on the - # Cargo.lock pin. - - name: Check the aggregate action refs match the pin - if: always() - run: | - if grep -E 'polymorph-test/actions/aggregate@[0-9a-f]{40}' .github/workflows/ci.yml | grep -qv "@${{ steps.ct-rev.outputs.rev }}"; then - echo "aggregate action ref skew: not at the Cargo.lock rev ${{ steps.ct-rev.outputs.rev }}" >&2 - exit 1 - fi - + # semantics cannot skew from the pin. The action's cargo-lock + # input polices the `uses:` refs against the pin. - name: Publish the conformance matrix if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != '' - uses: polymorph-components/polymorph-test/actions/aggregate@824d100349dc7804c9bf1723d9b1ba0ed40fa940 + uses: polymorph-components/polymorph-test/actions/aggregate@76c094576076284c1a7d0ea1b7bb724e9e7384a5 with: lock: conformance/guest-ct/tests.lock manifest: conformance/driver-ct/targets.toml @@ -191,10 +169,11 @@ jobs: jco-browser=conformance/driver-ct/results/jco-browser.jsonl summary-title: Conformance matrix cli: target/ct-tools/bin/component-test + cargo-lock: Cargo.lock - name: Publish the signing conformance matrix if: always() && hashFiles('conformance/driver-ct/results/*.jsonl') != '' - uses: polymorph-components/polymorph-test/actions/aggregate@824d100349dc7804c9bf1723d9b1ba0ed40fa940 + uses: polymorph-components/polymorph-test/actions/aggregate@76c094576076284c1a7d0ea1b7bb724e9e7384a5 with: lock: conformance/signing-guest-ct/tests.lock manifest: conformance/driver-ct/targets-signing.toml @@ -204,6 +183,7 @@ jobs: jco-browser=conformance/driver-ct/results/jco-browser-signing.jsonl summary-title: Signing conformance matrix cli: target/ct-tools/bin/component-test + cargo-lock: Cargo.lock - name: Upload the conformance results # Feeds the Pages viewer (the latest main run's results pane) diff --git a/AGENTS.md b/AGENTS.md index 0d81c79..2586204 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -354,11 +354,11 @@ skip the npm install). The polymorph:test stack is a git dependency pinned by rev in the root `Cargo.toml` and enforced by `Cargo.lock`; cargo fetches it, and `conformance-ct::_ct-tools` cargo-installs the `component-test`/`ct-runner` binaries at the same locked rev. To bump -the pin: edit the rev in `Cargo.toml`, run `cargo update -p -component-test-sdk -p component-test-runner`, and commit the lock diff; -the npm pin in `conformance/driver-ct/jco` and the `actions/aggregate` -refs in `.github/workflows/ci.yml` move with it (the `_ct-tools` pins -gate and the CI ref guard fail on skew). +the pin: `component-test pins bump --cargo-toml Cargo.toml +--package-json conformance/driver-ct/jco/package.json --workflow +.github/workflows/ci.yml`, then the follow-ups it prints (`cargo +update`, `npm install`); the `_ct-tools` pins gate and the actions' +own ref checks fail on skew. To develop against a local component-test checkout, add a temporary override to the root `Cargo.toml` (do not commit it): diff --git a/Cargo.lock b/Cargo.lock index 7105fed..ff1bf73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "component-test-core" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=824d100349dc7804c9bf1723d9b1ba0ed40fa940#824d100349dc7804c9bf1723d9b1ba0ed40fa940" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" dependencies = [ "arcstr", "serde", @@ -345,7 +345,7 @@ dependencies = [ [[package]] name = "component-test-formats" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=824d100349dc7804c9bf1723d9b1ba0ed40fa940#824d100349dc7804c9bf1723d9b1ba0ed40fa940" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" dependencies = [ "anyhow", "component-test-core", @@ -360,7 +360,7 @@ dependencies = [ [[package]] name = "component-test-results" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=824d100349dc7804c9bf1723d9b1ba0ed40fa940#824d100349dc7804c9bf1723d9b1ba0ed40fa940" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" dependencies = [ "anyhow", "component-test-core", @@ -371,7 +371,7 @@ dependencies = [ [[package]] name = "component-test-runner" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=824d100349dc7804c9bf1723d9b1ba0ed40fa940#824d100349dc7804c9bf1723d9b1ba0ed40fa940" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" dependencies = [ "anyhow", "component-test-core", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "component-test-sdk" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=824d100349dc7804c9bf1723d9b1ba0ed40fa940#824d100349dc7804c9bf1723d9b1ba0ed40fa940" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" dependencies = [ "component-test-core", "component-test-sdk-macro", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "component-test-sdk-macro" version = "0.1.0" -source = "git+https://github.com/polymorph-components/polymorph-test?rev=824d100349dc7804c9bf1723d9b1ba0ed40fa940#824d100349dc7804c9bf1723d9b1ba0ed40fa940" +source = "git+https://github.com/polymorph-components/polymorph-test?rev=76c094576076284c1a7d0ea1b7bb724e9e7384a5#76c094576076284c1a7d0ea1b7bb724e9e7384a5" dependencies = [ "component-test-core", "proc-macro2", @@ -2457,7 +2457,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.4.3", + "getrandom 0.3.4", "once_cell", "rustix", "windows-sys 0.61.2", diff --git a/Cargo.toml b/Cargo.toml index 75c06dd..edbe85d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,8 @@ resolver = "2" # override — see AGENTS.md "Build & run". Publishing component-test # to a registry retires this arrangement. [workspace.dependencies] -component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "824d100349dc7804c9bf1723d9b1ba0ed40fa940" } -component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "824d100349dc7804c9bf1723d9b1ba0ed40fa940" } +component-test-sdk = { git = "https://github.com/polymorph-components/polymorph-test", rev = "76c094576076284c1a7d0ea1b7bb724e9e7384a5" } +component-test-runner = { git = "https://github.com/polymorph-components/polymorph-test", rev = "76c094576076284c1a7d0ea1b7bb724e9e7384a5" } # The mutation run's profile (`just mutants`): dependencies optimized — # wasmtime and the RustCrypto cores are compiled once, at baseline, and make diff --git a/conformance/driver-ct/jco/package-lock.json b/conformance/driver-ct/jco/package-lock.json index 9f58894..6ccd8f7 100644 --- a/conformance/driver-ct/jco/package-lock.json +++ b/conformance/driver-ct/jco/package-lock.json @@ -8,7 +8,7 @@ "dependencies": { "@bytecodealliance/jco-transpile": "^0.5.2", "@bytecodealliance/preview2-shim": "^0.17.4", - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#824d100349dc7804c9bf1723d9b1ba0ed40fa940", + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5", "playwright-core": "^1.61.1" } }, @@ -451,9 +451,12 @@ }, "node_modules/@polymorph/component-test-js": { "version": "0.2.0", - "resolved": "git+ssh://git@github.com/polymorph-components/polymorph-test.git#824d100349dc7804c9bf1723d9b1ba0ed40fa940", - "integrity": "sha512-O04zBrGMfoDAKNY9hbssRK0w69ze8hT4IHwztKqbgrKDF9U1ScUFHw4yh+pm/v3pDynj97Enp1A++KHTOp/j4Q==", - "license": "Apache-2.0 WITH LLVM-exception" + "resolved": "git+ssh://git@github.com/polymorph-components/polymorph-test.git#76c094576076284c1a7d0ea1b7bb724e9e7384a5", + "integrity": "sha512-nvkB8aRSsA/B+eQnIrH92Uj1v4qmzj5a9N7lylDhDMqc97IeWPox4eZqTtSX6mxl0lsiotZeU9z0u/BcLBVuqg==", + "license": "Apache-2.0 WITH LLVM-exception", + "bin": { + "component-test-jco-transpile": "js/jco-transpile.mjs" + } }, "node_modules/@tybys/wasm-util": { "version": "0.10.3", diff --git a/conformance/driver-ct/jco/package.json b/conformance/driver-ct/jco/package.json index 2be6a0d..edefb7a 100644 --- a/conformance/driver-ct/jco/package.json +++ b/conformance/driver-ct/jco/package.json @@ -4,15 +4,15 @@ "type": "module", "description": "jco drivers (Node + headless browser) for the ported conformance suites: transpiles conformance-guest-ct and conformance-signing-guest-ct against the browser-first host (js/jco/webcrypto.js) plus a JS test-context provider, and runs them with mark scheduling under Node (runner.mjs) or headless Chromium (run-browser.mjs).", "scripts": { - "transpile": "node ../../../scripts/jco-transpile.mjs transpile ../../../target/wasm32-wasip2/release/conformance_guest_ct.wasm --name conformance-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated", - "transpile:signing": "node ../../../scripts/jco-transpile.mjs transpile ../../../target/wasm32-wasip2/release/conformance_signing_guest_ct.wasm --name conformance-signing-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated", + "transpile": "component-test-jco-transpile transpile ../../../target/wasm32-wasip2/release/conformance_guest_ct.wasm --name conformance-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated", + "transpile:signing": "component-test-jco-transpile transpile ../../../target/wasm32-wasip2/release/conformance_signing_guest_ct.wasm --name conformance-signing-guest-ct --async-mode jspi --map 'polymorph:webcrypto/*@0.1.0=../../../../js/jco/webcrypto.js#*' --map 'polymorph:test/test-context@0.1.0=../../context.js' --map 'wasi:cli/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' --map 'wasi:clocks/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/clocks.js#*' --map 'wasi:io/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/io.js#*' --map 'wasi:random/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/random.js#*' --map 'wasi:filesystem/*=../node_modules/@bytecodealliance/preview2-shim/lib/browser/filesystem.js#*' -o generated", "run": "node --experimental-wasm-jspi runner.mjs", "run:browser": "node run-browser.mjs" }, "dependencies": { "@bytecodealliance/jco-transpile": "^0.5.2", "@bytecodealliance/preview2-shim": "^0.17.4", - "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#824d100349dc7804c9bf1723d9b1ba0ed40fa940", + "@polymorph/component-test-js": "github:polymorph-components/polymorph-test#76c094576076284c1a7d0ea1b7bb724e9e7384a5", "playwright-core": "^1.61.1" } } diff --git a/conformance/driver-ct/jco/run-browser.mjs b/conformance/driver-ct/jco/run-browser.mjs index 6b44272..59177cc 100644 --- a/conformance/driver-ct/jco/run-browser.mjs +++ b/conformance/driver-ct/jco/run-browser.mjs @@ -199,7 +199,7 @@ async function main() { const run = outcome[suite]; if (!run) throw new Error(`the page reported no run for suite ${suite}`); const lines = [ - JSON.stringify(envelope(values.target, suite.replaceAll("-", "_"))), // lockfile identity: wasm file stem + JSON.stringify(envelope(values.target, suite)), // lockfile identity: wasm file stem ...run.events.map((event) => JSON.stringify(event)), '{"segment-end":true}', ]; diff --git a/conformance/driver-ct/jco/runner.mjs b/conformance/driver-ct/jco/runner.mjs index 6e0932b..09db82f 100644 --- a/conformance/driver-ct/jco/runner.mjs +++ b/conformance/driver-ct/jco/runner.mjs @@ -60,7 +60,7 @@ if (jsonl) { // The lockfile names the suite by its wasm file stem (underscores); // the transpile name is hyphenated. Envelope with the lockfile identity // so the aggregate's cross-check stays quiet. - const lines = [JSON.stringify(envelope(values.target, suite.replaceAll("-", "_")))]; + const lines = [JSON.stringify(envelope(values.target, suite))]; for (const { event } of rows) lines.push(JSON.stringify(event)); lines.push('{"segment-end":true}'); console.log(lines.join("\n")); diff --git a/conformance/driver-ct/justfile b/conformance/driver-ct/justfile index 809617f..71fa3ed 100644 --- a/conformance/driver-ct/justfile +++ b/conformance/driver-ct/justfile @@ -125,7 +125,7 @@ _viewer-prepared: _jco-prepared --target wasm32-wasip2 --release -p viewer-aggregate cd jco node stage-viewer.mjs "$src" - node ../../../scripts/jco-transpile.mjs transpile \ + node_modules/.bin/component-test-jco-transpile transpile \ "$src/target/wasm32-wasip2/release/viewer_aggregate.wasm" \ --name viewer-aggregate \ --map 'wasi:cli/*=../../node_modules/@bytecodealliance/preview2-shim/lib/browser/cli.js#*' \