Skip to content

fix(ci): stop compiling better-sqlite3 from source on Node 24 - #3378

Merged
benjaminshafii merged 1 commit into
devfrom
fix/ci-better-sqlite3-node24-prebuilds
Jul 31, 2026
Merged

fix(ci): stop compiling better-sqlite3 from source on Node 24#3378
benjaminshafii merged 1 commit into
devfrom
fix/ci-better-sqlite3-node24-prebuilds

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

The failure

OpenWork Tests on Linux dies during pnpm install --frozen-lockfile (e.g. #3371, run 30575171143):

.../better-sqlite3 install: prebuild-install warn install No prebuilt binaries found (target=24.13.0 runtime=node arch=x64 libc= platform=linux)
.../better-sqlite3 install: gyp http GET https://nodejs.org/download/release/v24.13.0/node-v24.13.0-headers.tar.gz
.../better-sqlite3 install: gyp ERR! stack AggregateError [ETIMEDOUT]:
[ELIFECYCLE] Command failed with exit code 1

Root cause

better-sqlite3@11.10.0 publishes prebuilds for node-v108/115/127/131no node-v137, which is Node 24. Every CI job runs node-version: 24, so prebuild-install always missed, fell back to node-gyp rebuild, and reached out to nodejs.org for headers mid-install. Any hiccup on that request fails the whole install. It was never green-by-design, just green-when-the-network-cooperated.

Fix

  • Bump better-sqlite3 to ^12.11.1 in apps/server and apps/desktop. That release ships node-v127/137/141/147 and electron-v133 (we're on Electron 35) prebuilds, so installs download a binary instead of compiling.
    • 12.0.0 was a build-matrix-only major (dropped EOL Node 18 / Electron 26-28) — no JS API change, and our usage is new Database() + prepare() in apps/server/src/opencode-db.ts.
    • Not 13.x: it just landed (2026-07-29) and switches to N-API, which also trips minimumReleaseAge: 4320.
  • Cache the pnpm store in ci-tests.yml (same pattern already used by alpha-macos-aarch64.yml / release-macos-aarch64.yml) and install with --prefer-offline. The log showed reused 0 on every progress line — CI was re-downloading all 1453 packages each run, which is both slow and more network to flake on.

Verification

Run locally on the dev base in a fresh worktree (macOS arm64):

Command Result
pnpm install --frozen-lockfile better-sqlite3 install: Done in seconds, build/Release/better_sqlite3.node present with no obj.target compile artifacts — prebuild path, no node-gyp
node -e "new (require('better-sqlite3'))(':memory:')..." sqlite 3.53.2 | node 25.2.1
pnpm --filter openwork-server test 600 pass, 10 skip, 0 fail
pnpm --filter @openwork/desktop test 174 pass, 1 skip, 0 fail
pnpm check:outbound-access pass (35 hosts covered)
pnpm --filter @openwork/desktop typecheck:electron pass
pnpm --filter @openwork/app test 566 pass / 2 fail — pre-existing on dev, unrelated: message-list-loading.test.tsx fails only inside the full-suite run (target.addEventListener is not a function from a DOM global clobbered by another file) and passes in isolation; dev's own CI run is green on this lane

The real proof for this change is this PR's own OpenWork Tests run: the install step should no longer print No prebuilt binaries found / gyp output at all.

No user-visible surface changes (dependency + workflow only), so no fraimz was recorded — per the agreement in the request, CI green plus the local runs above is the evidence.

better-sqlite3 11.10.0 ships no `node-v137` (Node 24) prebuild, so every CI
install fell through `prebuild-install` to `node-gyp rebuild`, which downloads
the Node headers from nodejs.org mid-install. When that request stalls the whole
install dies:

    prebuild-install warn install No prebuilt binaries found (target=24.13.0 ...)
    gyp ERR! stack AggregateError [ETIMEDOUT]
    [ELIFECYCLE] Command failed with exit code 1

Bump better-sqlite3 to ^12.11.1, which publishes node-v137 (and v127/v141/v147)
prebuilds, so installs fetch a binary instead of compiling. 12.0.0 was a
build-matrix-only major (dropped EOL Node 18 / Electron 26-28); the JS API is
unchanged and Electron 35 (ABI 133) prebuilds are still published.

Also cache the pnpm store in the tests workflow, matching the release/alpha
workflows: OpenWork Tests was re-downloading all 1453 packages every run
("reused 0"), which is both slow and extra network surface to flake on.
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Jul 31, 2026 10:41am
openwork-den Ready Ready Preview Jul 31, 2026 10:41am
openwork-den-worker-proxy Ready Ready Preview Jul 31, 2026 10:41am
openwork-diagnostics Ready Ready Preview Jul 31, 2026 10:41am
openwork-landing Ready Ready Preview, v0 Jul 31, 2026 10:41am

@benjaminshafii

Copy link
Copy Markdown
Member Author

CI evidence

Run 1 — the compile is gone (job 91135979688):

.../better-sqlite3 install$ prebuild-install || node-gyp rebuild --release
.../better-sqlite3 install: Done          # 0.3s, no "No prebuilt binaries found", no gyp output

Run 2 — the store cache is doing its job (job 91137548193):

Cache restored from key: Linux-pnpm-1f5fed3e...
Progress: resolved 1459, reused 1451, downloaded 0, added 1459, done     # was: reused 0, downloaded 1451
Progress: resolved 50, reused 50, downloaded 0, added 50, done           # evals workspace

better-sqlite3 doesn't even run its install script on the cached run.

All checks green on both runs, including openwork-tests (blacksmith-4vcpu-ubuntu-2204) and openwork-tests (macos-14) — which also confirms the 2 @openwork/app failures I saw locally are a local-environment artifact, not this change.

@benjaminshafii
benjaminshafii enabled auto-merge (squash) July 31, 2026 11:18
@benjaminshafii
benjaminshafii merged commit 87be560 into dev Jul 31, 2026
23 checks passed
@benjaminshafii
benjaminshafii deleted the fix/ci-better-sqlite3-node24-prebuilds branch July 31, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants