fix: add missing nix build dependencies for node-gyp#214
Open
pcasaretto wants to merge 1 commit intotobi:mainfrom
Open
fix: add missing nix build dependencies for node-gyp#214pcasaretto wants to merge 1 commit intotobi:mainfrom
pcasaretto wants to merge 1 commit intotobi:mainfrom
Conversation
node-gyp needs python3 to compile better-sqlite3, and on macOS it also needs libtool from cctools to create static libraries. Without these, `nix build` fails in the sandbox.
pcasaretto
added a commit
to pcasaretto/nix-home
that referenced
this pull request
Feb 18, 2026
Bun 1.3.x reports process.version as v24.3.0, so prebuild-install can't find prebuilt binaries for better-sqlite3 and falls through to node-gyp. Workaround until tobi/qmd#214 is merged.
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.
Summary
nix buildfails becausenode-gypcan't compilebetter-sqlite3inside the Nix sandbox.Root cause
The flake tracks
nixpkgs-unstable, which now ships bun 1.3.x (previously 1.1.x). This changes howbetter-sqlite3's install script behaves.The install script runs
prebuild-install || node-gyp rebuild. Theprebuild-installstep looks for prebuilt binaries matching the Node version that bun reports viaprocess.version:process.versionas Node 18 — prebuilt binaries exist for Node 18, soprebuild-installdownloads them andnode-gypis never invoked.process.versionasv24.3.0— no prebuilt binaries exist for Node 24, soprebuild-installfails and falls through tonode-gyp rebuild, which needspython3andlibtool(macOS) to compile from source.The build log confirms this:
Fix
Add the missing native build dependencies so
node-gypcan compilebetter-sqlite3:node-gypto run its build scriptslibtoolfor creating static librariesTest plan
nix buildsucceeds on macOS (aarch64-darwin) with nixpkgs containing bun 1.3.x