Repository navigation
fix(ci): cache native dependency outputs for hosted jobs - #155387
Merged
RomneyDa merged 1 commit intoSep 22, 2026
Merged
Conversation
CI setup could fail before lint or tests when Matrix crypto native-library downloads hit a transient release-CDN error. Hosted store-only readers used a different cache path from the publisher, and hybrid mode seeded only the Blacksmith Linux backend. Align the existing setup action and warmer on the workspace-local pnpm store, publish completed native installation outputs before unrelated build work, and add one install-only hosted warmer row in hybrid mode. Bound installed-Node discovery to four levels to avoid traversing bundled npm dependencies. The existing warmer remains the sole publisher and PR consumers remain restore-only. Current-head hosted warm setup completed in 22 seconds with 1,436 packages reused, zero downloads, and Matrix postinstall skipped, compared with the recorded ten-job 45-second baseline median. This is an observed sample, not a measured fleet-wide median change. Cold caches and changed native inputs still require upstream assets. No application runtime, configuration, dependency, or permission changes. Validation: exact-head PR CI run 35197161825 returned GREEN; the accepted Codex review and exact-head ClawSweeper review found no actionable issues. The PR also records passing targeted Node/cache guards, workflow checks, and cold/warm native reuse proof. Related: #150637, #150526.
RomneyDa
marked this pull request as ready for review
September 22, 2026 03:17
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.
Related: #150725
What Problem This Solves
Fixes an issue where extended-stable validation could fail before tests when Matrix crypto's native-library download encountered a transient GitHub release-CDN reset. The frozen candidate reproduced this in
checks-node-compat-node22, where dependency installation downloaded the native library, receivedECONNRESET, and then hit the dependency's undefinederrcatch path.Why This Change Was Made
Backports the complete cache-owner repair from #150725 while preserving the stable branch's older workflow topology. Cache-enabled Linux readers now use the publisher's workspace-local pnpm store path, hybrid mode seeds GitHub-hosted Linux separately from Blacksmith, and the completed store is published immediately after setup instead of after unrelated build and test warming. This avoids a downloader retry, dependency patch, binary vendoring, or runtime change.
Stable does not contain main's later native SDK boundary cache steps or
docs/ci/runners.md, so the backport keeps those absent and updates the equivalent stable contract indocs/ci.md.User Impact
Release and CI jobs can reuse Matrix's pnpm-cached native postinstall output instead of re-downloading it on every compatible hosted cache hit. Cold caches and changed dependency inputs still use the upstream download. There is no product runtime or configuration change.
Evidence
checks-node-compat-node22downloaded@matrix-org/[email protected], failed withread ECONNRESET, then failed indownload-lib.jsbecauseerris undefined. Tests never started; the aggregateci-gatefailure was derivative.0.6.6runsnode download-lib.jsinpostinstall; an existing matching binary and.versionmarker skip the download; its downloader has no retry and its catch block references undefinederr.node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts test/scripts/setup-pnpm-store-cache-ensure-node.test.ts— 211 passed, 2 skipped.node scripts/check-changed.mjs -- <six changed paths>— passed all selected test-root, docs, and tooling gates.pnpm docs:list, targetedoxfmt --check, andgit diff --check— passed.node --import tsx scripts/check-workflows.mtsreached its Python environment setup but could not install the repo-pinnedpre-commit==4.6.2from this host's configured package index. Exact-head Workflow Sanity CI remains the required proof for that gate.find -maxdepthmacOS portability concern. Direct Darwin 25.5.0 proof showed/usr/bin/find ... -maxdepth 0exits 0, and the installed macOS manpage documents the predicate; the finding was rejected and no code changed.Scope: CI tooling +18/-22, tests +42/-15, docs +2/-2; no application production changes. Hybrid adds one GitHub-hosted warmer row and no Blacksmith registrations.