Skip to content

fix(build): follow-ups from the xterm build-cache review (#2138) #2148

Closed

Description

@devswha

Follow-up to #2138 (LOW notes from the merge pass's review; none blocked).

  • A killed build (SIGKILL, OOM, Ctrl-C) leaves its <key>.tmp-* staging directory behind until node_modules is reinstalled (scripts/build-xterm.ts ~40/52); reproduced with kill -9. Remove old staging siblings when starting a fresh emit.
  • The published key directory keeps mkdtempSync's 0700 mode; a checkout built by one user and read by another would get EACCES. chmodSync(staging, 0o755) before the rename.
  • Hash/compile race can publish stale output under a key (Codex MEDIUM, ~34): if the source changes between hashing and TypeScript reading it, the changed output is published under the original key, and restoring the original source reuses it; reproduced with a deterministic compiler-read hook (main rebuilds every time). Compile the bytes that were hashed, or re-hash and discard before publishing.
  • Package resolution metadata is not in the key (Codex MEDIUM, ~32): changing only xterm's package.json types field selects different declarations without invalidating the cache; reproduced. Hash the manifest's resolution fields.

Activity

  1. added a commit that references this issue on Oct 28, 2026
    de80980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions