Skip to content

Merge upstream (gh/WiseLibs/better-sqlite3) changes#42

Merged
tantaman merged 12 commits into
mainfrom
mlaw/merge
Jun 5, 2026
Merged

Merge upstream (gh/WiseLibs/better-sqlite3) changes#42
tantaman merged 12 commits into
mainfrom
mlaw/merge

Conversation

@tantaman
Copy link
Copy Markdown
Contributor

@tantaman tantaman commented Jun 5, 2026

No description provided.

JoshuaWise and others added 11 commits April 12, 2026 21:31
Co-authored-by: m4heshd <6711514+m4heshd@users.noreply.github.com>
Add SQLITE_ENABLE_PERCENTILE compile-time option
Co-authored-by: m4heshd <6711514+m4heshd@users.noreply.github.com>
* Add support for Node.js v26 prebuilds

* Update `mocha` to the latest version

* Add Node v26 to supported engines
Temporarily rollback support for electron v42 prebuilds

Avoid building for electron v42 till the updated V8 API errors are sorted out.
Sync with upstream WiseLibs/better-sqlite3 while preserving this fork's
intentional divergences. All conflicts resolved in favor of our fork,
except we adopt upstream's SQLITE_ENABLE_PERCENTILE flag and Node 26 CI
support.

Kept ours (rejected upstream changes):
- deps/sqlite3/{sqlite3.c,sqlite3.h,sqlite3ext.h}: stay on our
  begin-concurrent checkin 0e862bc9ed7aa9ae (SQLite 3.51.0); do NOT take
  upstream's SQLite 3.53.1. sqlite3ext.h restored to ours so the bundled
  amalgamation remains a coherent 3.51.0 set -- upstream auto-merged
  3.52.0 api routines (str_truncate/carray_bind/...) that our sqlite3.c
  does not implement.
- deps/download.sh: keep CHECKIN-based source fetch, not VERSION release.
- .github/workflows/build.yml: keep our reworked CI (electron prebuilds
  dropped, native ARM runners); still drop upstream's electron v42 change.
- package.json: keep @rocicorp/zero-sqlite3 1.1.1, our engines and deps.

Adopted from upstream:
- SQLITE_ENABLE_PERCENTILE (#1447): percentile()/median() aggregates.
  Already bundled in our amalgamation behind the ifdef, so this is a pure
  flag flip -- no rebuild. Added to defines.gypi (auto-merged),
  download.sh, and compilation.md to keep them consistent.
- Node.js v26 support (#1468), adapted to our CI: added -t 26.0.0 to the
  MODERN prebuild command and 26 to the test matrix (GCC-11/bookworm path
  via the existing matrix.node >= 25 conditional). engines stays LTS-only
  (22.x||24.x), consistent with how we already treat node 25.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mocha 10 bundles yargs 16, whose extensionless `yargs/yargs` entry calls
require() and crashes under Node 26's module resolution ("ReferenceError:
require is not defined in ES module scope"), failing every Node 26 CI job
at `npm test` before any test runs. mocha 11 ships yargs 17, which works.
This is the devDep bump upstream paired with its Node 26 support; we'd
declined it during the merge.

Verified locally: Node 26.2.0 -> 338 passing; Node 24.4.1 -> 337 passing,
1 pending (no regression). Test-only change; shipped package unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 5, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmocha@​11.7.6981009595100

View full report

Node 26's bundled gyp config feeds Clang/LLD ThinLTO flags (-flto=thin,
/opt:lldltojobs=2) into the addon's MSVC link step, which link.exe rejects
with LNK1117. Our build defines no LTO flags and Node <=25 builds fine on
Windows, so this is an upstream Node 26 + MSVC toolchain issue (it also
breaks Windows+Node26 source installs, independent of this repo) and isn't
reproducible off-Windows.

Exclude windows-2022 + Node 26 from the test matrix so CI is green; Node 26
stays fully tested on macOS and Linux. The release-only Windows prebuild job
still lists Node 26 via NODE_BUILD_CMD_MODERN and will need the same
exclusion before the next release.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tantaman tantaman merged commit 491e6e7 into main Jun 5, 2026
28 checks passed
@tantaman tantaman deleted the mlaw/merge branch June 5, 2026 14:17
@tantaman tantaman mentioned this pull request Jun 5, 2026
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.

4 participants