🤖 fix: drop node-pty and the Electron rebuild step, make buildTime reproducible - #4309
Conversation
node-pty 1.1.0-beta39 and @lydell/node-pty are both Node-API modules, so no Electron ABI rebuild is needed. Keep only @lydell/node-pty, which ships prebuilds for every supported platform. Remove postinstall.sh, @electron/rebuild, make rebuild-native, and the two-package loader. Stamp buildTime from SOURCE_DATE_EPOCH or the commit time so the Nix output is reproducible; set SOURCE_DATE_EPOCH in flake.nix.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The Nix build at
60d40394dhad two problems:postinstall.shalways failed inside the sandbox (no Electron headers,--ignore-scriptsin the FOD) andexit 0swallowed the failure, andbuildTimecame from the wall clock so the output was never reproducible.Whilst looking into the first one, it turned out the rebuild step never did necessary work. #660 moved us to
node-pty@1.1.0-beta39and added@electron/rebuildin the same PR, but beta39 is wherenode-ptyswitched fromnantonode-addon-api. Node-API is ABI-stable across Node and Electron, so the rebuild was producing a binary functionally identical to the prebuild it overwrote. #664 then added@lydell/node-ptyas a fallback on the assumption that its Mac prebuilds weren't built for the Electron ABI; they're Node-API too, and the desktop app has been loading them inside Electron for SSH, Docker and devcontainer terminals since that PR landed. On Linuxnode-ptyhas no prebuild at all, so Nix and Docker were already on@lydellfor every terminal.So, we'll just keep
@lydell/node-pty. This removesnode-pty,@electron/rebuild,scripts/postinstall.sh,make rebuild-native, the two-package loader inptySpawn.ts, and theXUM_HEADLESSplumbing in the Dockerfile, flake and benchmark setup. The DuckDB rebuild step goes too;@duckdb/node-bindingshas nobinding.gyp, so it was a no-op.asarUnpacknow covers@lydell/**sopty.node,spawn-helperand the conpty files leave the asar.@types/nodeis pinned at^24.9.0because it was previously hoisted fromelectronand would otherwise fall back to the Node 20 types.For
buildTime,generate-version.shnow usesSOURCE_DATE_EPOCH, falling back to the commit time and then the wall clock (Docker builds have no.git). The flake setsSOURCE_DATE_EPOCHfromself.lastModifiedso About shows the commit date rather than 1980. The "reuse existing buildTime" block from #2915 is gone since the existingcmp -searly exit now gives the same HMR stability. Release builds will show the tagged commit's time rather than when CI ran.I verified the untouched
@lydellLinux prebuild from the Nix output loads and spawns a shell under Electron 40.10.0 and 43.6.0 viaELECTRON_RUN_AS_NODE, andnix build .#xum --rebuildpasses. The one path that actually changes behaviour is Local terminals on macOS/Windows desktop, which move from one Node-API pty prebuild to another of the same fork. I haven't runmake dist-win, so Windows desktop is the least exercised path here.Unrelated: the
offlineCacheFOD flakes withFail extracting tarball for "mermaid"in roughly 2 of 3 sandbox runs, with both the old and new lockfile. I dug into it (strace,curlinside the sandbox) and it looks like a bun extraction flake on the largest tarball rather than a network or lockfile issue. Out of scope for now.Generated with
xum• Model:anthropic:claude-fable-5-1• Thinking:xhigh• Cost:$17.46