feat: node26 image using built-in node:sqlite (drop native toolchain)#2
Merged
Merged
Conversation
Moves the FreeBSD Papra image to node26 (matching upstream's .nvmrc) and replaces the better-sqlite3 driver swap with node26's built-in node:sqlite, driven through drizzle-orm/sqlite-proxy. This removes the entire C toolchain from the builder (no FreeBSD-clang/lld/toolchain/clibs-dev, no node-gyp, python, gmake) -- there is no native addon to compile -- and decouples the DB layer from node ABI churn (the better-sqlite3 11->12 break on node26 was exactly this class of problem). node26 specifics: - node26 ships only in FreeBSD's `latest` pkg branch (the base image points at `quarterly`, which tops out at node25), so switch the branch before install in both stages. - papra uses the TC39 Temporal global. Official node26 ships it built-in, but FreeBSD's node26 package is compiled WITHOUT it (and --harmony-temporal is a no-op here), so preload a spec-compliant polyfill via `node --import temporal-polyfill/global`. database.ts maps node:sqlite to the libsql semantics papra expects: - sqlite-proxy callback uses StatementSync.setReturnArrays(true) for the positional rows drizzle's query builder wants. - attachBatch: custom db.batch (sqlite-proxy's native batch can't handle papra's eagerly-executed db.run() results). - attachLibsqlRaw: raw db.run/all/get return libsql's row OBJECTS (migrations 0010-0019 read db.run(...).rows; the health check reads db.all(...)). The other three FreeBSD patches (health-check, tasks-driver, migration 0006) are unchanged. Remote libSQL/Turso URLs remain unsupported (local file DB only) -- same as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the FreeBSD Papra image to node26 (matching upstream's .nvmrc) and replaces the better-sqlite3 driver swap with node26's built-in node:sqlite, driven through drizzle-orm/sqlite-proxy. This removes the entire C toolchain from the builder (no FreeBSD-clang/lld/toolchain/clibs-dev, no node-gyp, python, gmake) -- there is no native addon to compile -- and decouples the DB layer from node ABI churn (the better-sqlite3 11->12 break on node26 was exactly this class of problem).
node26 specifics:
latestpkg branch (the base image points atquarterly, which tops out at node25), so switch the branch before install in both stages.node --import temporal-polyfill/global.database.ts maps node:sqlite to the libsql semantics papra expects:
The other three FreeBSD patches (health-check, tasks-driver, migration 0006) are unchanged. Remote libSQL/Turso URLs remain unsupported (local file DB only) -- same as before.