fix(nix): build with Node.js 22 now that nixpkgs marks Node 20 insecure - #1406
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe Nix flake replaces Node.js 20 with Node.js 22 in the package derivation and development shell inputs. ChangesNix Node.js runtime update
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
TabishB
left a comment
There was a problem hiding this comment.
Looks good, might be worth doing a sweep of node version across the board. I noticed this warning on our build-deploy CI earlier too:
build-and-deployNode.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-node@v4, pnpm/action-setup@v4. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
--
[build-and-deploy](https://github.com/xianzheTM/OpenSpec/actions/runs/29812867479/job/88577515496#step:13:2)
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4, actions/setup-node@v4, pnpm/action-setup@v4. For more information see: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
|
@TabishB Done — the sweep is up as #1407: it bumps every node20-runtime action to its current Node 24 major (checkout v5, setup-node v6, pnpm/action-setup v6, upload-artifact v6, paths-filter v4, create-github-app-token v3; changesets/action is already node24) and moves the devcontainer off the EOL Node 20 image. Each target major was verified against the action's Two things the sweep deliberately leaves alone, for the record:
|
|
@clay-good We can leave at 22 for now, we'll do 24 down the line |
Status: Approved by @TabishB; ready to merge.
What was wrong: The Nix flake pinned
nodejs_20in both the package build and the dev shell. Node.js 20 reached end of life on 2026-04-30, and nixpkgs now marks it insecure (NixOS/nixpkgs#511784). Anyone consuming the flake against current nixpkgs — the normal case for downstream flakes thatfollowstheir own nixpkgs — gets a hard evaluation failure before the build even starts, exactly as reported in #1119.How it was fixed: Both
nodejs_20references now usenodejs_22(maintenance LTS until April 2027). This stays within the package's declared support range (engines: node >=20.19.0) and matches the fix the issue suggests.Replication / proof:
nixos-unstable— nixpkgs refusesnodejs_20as insecure (full trace in [build] Nix build fails because NodeJS 20 was marked as insecure in nixpkgs #1119).nix-flake-validateCI job runsnix buildon everyflake.nixchange and verifiesresult/bin/openspecexists, so this PR's green check is a real build with Node 22.Notes:
nodejs_22; moving the flake tonodejs_24(which would outlast nixpkgs' insecure threshold by an extra year) is deferred as a follow-up down the line.flake.lockstill pins nixpkgs from 2026-01-05, which is why in-repo CI kept passing while downstream users broke. This PR deliberately leaves the lock alone to stay surgical; a follow-upnix flake updatewould let CI exercise the same nixpkgs users are on.nodejs_20mentions underopenspec/changes/archive/2026-01-07-add-nix-flake-support/are historical records of that change and are intentionally untouched; no live spec references a Node version.Fixes #1119
🤖 Generated with Claude Code