Repository navigation
fix(nix): pin dev shell to nodejs_24 and add python3 - #14613
Merged
diegosouzapw merged 1 commit intoSep 24, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
better-sqlite3 has a binding.gyp and no install script, so npm runs `node-gyp rebuild` for it. macOS /usr/bin/python3 is an Xcode CLT stub that cannot exec, node-gyp aborts with "Could not find any Python installation to use", and npm silently prunes the package because it is an optionalDependency. `nix develop` then ends on the postinstall.mjs CRITICAL banner with no working SQLite driver. nodejs_22 also ships npm 10, which rewrites package-lock.json on every install: it drops the npm 11 `libc` fields and downgrades undici 7.29.1 to 6.28.1 (221 deletions). nodejs_24 ships npm 11, which does not run unapproved install scripts, so the bundled prebuilds/darwin-arm64.node is used and the lockfile stays byte-identical. python3 is kept in the shell for any from-source native build. engines allow >=24.0.0 <27.
Ansh-Sonkusare
added a commit
to Ansh-Sonkusare/OmniRoute
that referenced
this pull request
Sep 23, 2026
The npm version changes what `npm install -g` produces, so it is part of the fixed-output hash. Build the package with nodejs_24 (npm 11), matching the dev shell fix proposed in cheaper-inference#14613, and recompute the hash: the Node 22 hash no longer matches under npm 11. Only the package is pinned. The shared `nodejs` binding used by the dev shell is left untouched so this does not conflict with cheaper-inference#14613. Verified on x86_64-linux with Node 24.16.0: `nix build .#default` succeeds, the server starts from the store, and login plus password and settings changes work and persist across a restart.
Collaborator
|
Thorough root-cause writeup and a great before/after repro — confirmed |
diegosouzapw
merged commit Sep 24, 2026
be877f5
into
cheaper-inference:release/v3.8.51
3 checks passed
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.
Problem
A clean
git clone+nix developon macOS (aarch64-darwin) ends with thepostinstall.mjsbanner and no SQLite driver:The banner blames npm ≥ 11 blocking install scripts, but the shell was running npm 10.9.7, so the suggested fixes do not apply.
Root cause
better-sqlite3ships abinding.gypand noinstallscript, so npm runsnode-gyp rebuildfor it automatically. On macOS without Xcode Command Line Tools,/usr/bin/python3is a stub that cannot exec (error: tool 'python3' not found), and the dev shell provides no Python:better-sqlite3is anoptionalDependency, so npm drops it silently — the install reports success and onlypostinstall.mjsnotices.Second, unrelated defect found in the same run:
nodejs_22ships npm 10, which rewritespackage-lock.jsonon every install — it strips the npm 11libcfields and downgradesundici7.29.1 → 6.28.1 (221 deletions). Committing that would regress the lockfile for everyone.Fix
flake.nixonly:nodejs_22→nodejs_24(npm 11.13.0 on nixos-25.11). npm 11 does not run unapproved install scripts, so the bundledprebuilds/darwin-arm64.nodeis used instead of a source build, and the lockfile stays byte-identical.enginesalready allows>=24.0.0 <27.pkgs.python3so any genuine from-source native build has a working interpreter.Test plan
Reproduce the failure on
release/v3.8.51:With this branch:
Verified on aarch64-darwin (macOS 27.0.0, nixpkgs
nixos-25.11): node v24.16.0, npm 11.13.0, Python 3.13.12,better-sqlite3loads, lockfile untouched.Notes
No production code under
src/,open-sse/,electron/orbin/is touched, so the PR test policy does not apply — the reproduction is the shell transcript above.#13076 also edits
flake.nix(Nix packaging / FOD, cc @Ansh-Sonkusare). The two changes are independent — that PR touches thepackagesoutput, this one thedevShells.defaultinput list — but they will textually conflict. Happy to rebase on top of #13076 whenever it lands, or to fold this into it if you prefer a single Nix PR.