fix(CI): upgrade yao-pkg and fix Node 24 native addon resolution#1520
Conversation
yao-pkg v6.13.1 has a compatibility issue with Node 24 where the runtime prelude throws ENOENT instead of allowing the bindings package to retry alternate paths for node_sqlite3.node. Upgrade to v6.14.1 which adds proper Node 24 support, add the native addon as a pkg asset as a fallback, and add a CI step that fails fast with a helpful message if the sqlite3 path changes in the future.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Update esbuild override from 0.25.12 to 0.27.3 to match the requirement of @yao-pkg/pkg@6.14.1, which requires esbuild@^0.27.3. The previous override caused a forced downgrade that risked runtime failures during the binary packaging step. Also fix the Windows sqlite-path matrix value to use forward slashes so the bash-based verification step correctly resolves the path, and add shell: bash to the Copy sqlite3 step for consistency.
Start the built binary after copy sqlite3 step, poll /health for up to 60 seconds, and fail the build if the binary crashes or never responds. Catches missing or mispathed node_sqlite3.node and other native addon issues before artifacts are signed and uploaded.
pkg 6.14.1's prelude resolves native addons at node_modules/sqlite3/build/node_sqlite3.node (without Release/) but the file only exists at build/Release/. Add a prepare-pkg-assets step to all build scripts that copies the .node file to the expected path and include both paths in pkg.assets so the snapshot contains the addon where the prelude looks for it. Also remove deprecated Vercel pkg from global install since the build scripts use the local @yao-pkg/pkg from node_modules/.bin.
wait PID || true always sets $? to 0 because true succeeds. Use wait PID || EXIT_CODE=$? instead so the actual process exit code is reported when the binary crashes during startup.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Summary
@yao-pkg/pkgfrom^6.12.0to^6.14.1— v6.14.0 added proper Node.js 24 support, fixing a runtime incompatibility where the prelude'sstatSyncpatch throws ENOENT before thebindingspackage can retry alternate paths fornode_sqlite3.nodenode_sqlite3.nodeas a pkg asset inpackage.jsonso the native addon is available in the snapshot's virtual filesystem as a fallback.nodefile location if the hardcodedsqlite-pathbecomes stale after a future sqlite3 upgradeContext
The deb package for 1.7.25-rc was crashing at startup with:
Root cause:
@yao-pkg/pkg@6.13.1's runtime prelude doesn't correctly handle Node v24's CJS module resolution for native addons. ThefindNativeAddonForStatfunction throws anENOENTerror (notMODULE_NOT_FOUND), which bypasses both pkg's own retry logic and thebindingspackage's path iteration.Test plan
node_sqlite3.nodeENOENT errornode_sqlite3.nodeis present in the build artifact alongside thecadtbinaryNote
Medium Risk
Moderate risk because it changes the binary packaging/release pipeline and how the
sqlite3native addon is shipped, which can break builds or runtime startup across platforms if paths/assets are wrong.Overview
Fixes Node 24 packaged-binary startup issues by upgrading
@yao-pkg/pkgto^6.14.1(and updating lockfile deps likeesbuild).Updates the
pkgbuild to explicitly bundle thesqlite3native addon: addsprepare-pkg-assetsto copynode_sqlite3.nodeto an additional location and lists both.nodepaths underpkg.assets.Hardens CI packaging in
.github/workflows/build.yamlby normalizing the Windowssqlite-path, removing globalpkginstall, adding a fail-fast check that the.nodefile exists, and running a smoke test that boots the built binary and pollsGET /healthbefore uploading artifacts.Written by Cursor Bugbot for commit c6c3f5c. This will update automatically on new commits. Configure here.