From 8a743469e96effa45d3292884b45a38df2cabf1f Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Sat, 12 Sep 2026 19:51:24 +0800 Subject: [PATCH] ci: document that the sqlite3 build allowlist moves in pnpm 11 pnpm 11 stopped reading pnpm.onlyBuiltDependencies from package.json -- it warns and ignores it, with the setting moving to pnpm-workspace.yaml. CI pins pnpm 10 so the current location still works, but a version bump would silently drop sqlite3's native build and take out every SQLite-backed test at once, reporting only "Could not locate the bindings file". Recorded next to each install step so whoever bumps pnpm sees why. Deliberately not migrated to the new location yet. Adding a pnpm-workspace.yaml makes pnpm 9 treat the repo as a workspace and refuse to run at all -- verified, `pnpm install` fails with "packages field missing or empty" and only succeeds once the file is removed. Migrating the setting has to happen together with raising the pnpm floor. An explicit `pnpm rebuild sqlite3` is not a substitute either: two sqlite3 versions resolve here and rebuild picks the transitive 5.1.7 rather than the 6.0.1 the tests load. Noticed because a deployment on pnpm 12 surfaced the warning. --- .github/workflows/test.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f8bea77..1a1aea6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,6 +19,11 @@ jobs: node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile + # sqlite3 是原生模块,没有 .node 绑定的话所有碰 SQLite 的测试都会挂。 + # 允许它跑 build 脚本的名单在 package.json 的 pnpm.onlyBuiltDependencies, + # 这里 pnpm 固定在 10 所以读得到。 + # 注意:这个位置从 pnpm 11 起被忽略(只会给个警告),届时要把设置搬到 + # pnpm-workspace.yaml 再一起升 pnpm 版本,否则 SQLite 相关测试会整片失败。 # src/version.ts 是 prebuild 生成的,typecheck 之前必须先有 - run: node scripts/generate-version.js - run: pnpm exec tsc --noEmit @@ -51,6 +56,11 @@ jobs: node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile + # sqlite3 是原生模块,没有 .node 绑定的话所有碰 SQLite 的测试都会挂。 + # 允许它跑 build 脚本的名单在 package.json 的 pnpm.onlyBuiltDependencies, + # 这里 pnpm 固定在 10 所以读得到。 + # 注意:这个位置从 pnpm 11 起被忽略(只会给个警告),届时要把设置搬到 + # pnpm-workspace.yaml 再一起升 pnpm 版本,否则 SQLite 相关测试会整片失败。 - run: node scripts/generate-version.js # PGlite 是编译成 WASM 的 Postgres,用来验证生成的 SQL 在 Postgres 上确实 # 跑得通;不需要服务端,所以比下面那个 job 快得多 @@ -87,6 +97,11 @@ jobs: node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile + # sqlite3 是原生模块,没有 .node 绑定的话所有碰 SQLite 的测试都会挂。 + # 允许它跑 build 脚本的名单在 package.json 的 pnpm.onlyBuiltDependencies, + # 这里 pnpm 固定在 10 所以读得到。 + # 注意:这个位置从 pnpm 11 起被忽略(只会给个警告),届时要把设置搬到 + # pnpm-workspace.yaml 再一起升 pnpm 版本,否则 SQLite 相关测试会整片失败。 - run: node scripts/generate-version.js # 这一组测的是 PGlite 覆盖不到的东西:TCP、认证、连接池超时与上限、 # 多 client 并发事务、pool.end()、以及 SQLite -> Postgres 整体迁移 @@ -110,6 +125,11 @@ jobs: node-version: 22 cache: pnpm - run: pnpm install --frozen-lockfile + # sqlite3 是原生模块,没有 .node 绑定的话所有碰 SQLite 的测试都会挂。 + # 允许它跑 build 脚本的名单在 package.json 的 pnpm.onlyBuiltDependencies, + # 这里 pnpm 固定在 10 所以读得到。 + # 注意:这个位置从 pnpm 11 起被忽略(只会给个警告),届时要把设置搬到 + # pnpm-workspace.yaml 再一起升 pnpm 版本,否则 SQLite 相关测试会整片失败。 - run: pnpm build # 确认打出来的包真的能被 import,且存储层的导出都在 - name: smoke test the built package