Repository navigation
Typecheck: own tsbuildinfo per combined project and cache incremental state in CI (CL-7415) - #629
Conversation
ad65969 to
683bb1e
Compare
Self-reviewRebased onto main (conflicts were only in
Targeted tests: Conflict risk: PR #632 ("re-pin Interchange vendor + sidecar modules") also touches |
…ive glob (CL-7415)
683bb1e to
8e49b78
Compare
Main's tsBuildInfoFile change (#629) touched every vendored tsconfig.json, so the sha256 tree hashes recorded for the 5bc9b5ee pin drifted. Recompute them via hashDirectory() so check:killdates passes.
Two defects
Shared tsbuildinfo clobbers itself. The combined
tsconfig.json(the file baretsc, ESLint's projectService, and editors discover by convention) extendstsconfig.src.json, inheritingtsBuildInfoFile: "dist/tsconfig.tsbuildinfo". The compositetsc --buildand the combined--noEmitcheck both write that same file, so each invalidates the other's incremental state on every run. Fix:COMBINED_COMPILER_OPTIONSinscripts/generate-tsconfig-references.tsnow setstsBuildInfoFile: "tsconfig.tsbuildinfo", landing next to the package'stsconfig.json(already gitignored via*.tsbuildinfo).combinedFieldsMatchalready iteratesObject.keys(COMBINED_COMPILER_OPTIONS), so drift detection picks the new key up for free. Regenerated everytsconfig.jsonwithbun run scripts/generate-tsconfig-references.ts. The vendoredvendor/intx/*/tsconfig.jsonfiles are generator output too, so their content hashes inscripts/checks/kill-dates.txtare updated in the same change.CI caches nothing for typecheck. The
typecheckjob in.github/workflows/ci.ymlonly restoresnode_modulesviasetup-workbench, so every PR pays the full cost from a cold cache. Added anactions/cache@v4step keyed onbun.lock,.bun-version,tsconfig.base.json,scripts/generate-tsconfig-references.ts, andgithub.sha, with arestore-keysprefix so a PR falls back to the newest matching cache (typically main's). Paths are listed per workspace root (apps/*/dist,packages/*/dist, ...) rather than**/dist/**: the recursive glob walksnode_modulesand follows every workspace symlink in it, and the save step ran for over 40 minutes before it was cancelled. With explicit roots the ~200 MB cache saves in 2s.CI timings,
bun run typecheckstep on this branchBaseline on main before this change: 416s to 446s step, 7m14s to 7m50s job.
What remains in the warm 174s is the 113 per-project
tsc -p --noEmitinvocations each re-reading their program on a 4-core runner even when buildinfo says nothing changed. Further cuts mean fewer projects (CL-7249) or a larger runner.Local timings (this worktree)
bun run typecheckrun 1 (tsconfigs just regenerated, effectively cold): 45.1s wallbun run typecheckrun 2 (warm): 11.4s wallbunx tsc --build tsconfig.build.jsonimmediately after: 0.33s (previously 13.5s, confirming defect 1 is fixed)Touch-test (does
tsc --buildskip on fresh mtimes?)TypeScript 6.0.3. After a warm build, touched every
.tsfile underpackages/andapps/(mtime only), then rantsc --build tsconfig.build.json: 2.5s wall on the first run (partial recompute, not the ~15s cold build; the content-hash check short-circuits most files even though--build's up-to-date check uses mtimes), 0.94s on the second. The per-project--noEmitchecks use--incrementalcontent hashes and do not care about mtimes at all.