Skip to content

fetchPnpmDeps: fix reproducibility of pnpm v11 store index - #522703

Merged
Scrumplex merged 4 commits into
NixOS:masterfrom
mkg20001:fix/pnpm-sqlite
May 24, 2026
Merged

Scrumplex merged 4 commits into
NixOS:masterfrom
mkg20001:fix/pnpm-sqlite

Conversation

@mkg20001

@mkg20001 mkg20001 commented May 21, 2026 •

Copy link
Copy Markdown
Member

The pnpm v11 store uses a SQLite database (index.db) whose binary format
is non-deterministic across platforms (version-valid-for number, etc).
This caused hash mismatches when building the same pnpmDeps on different
machines despite identical logical content.

Fix by dumping the SQLite database to a text SQL file during the fetch
phase and reconstructing it during the build phase. This ensures the
stored representation is fully deterministic.

See #521248 (comment) for context on how this issue surfaced in openclaw package

Assisted-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Things done

@mkg20001 mkg20001 mentioned this pull request May 21, 2026
4 of 13 tasks
@nixpkgs-ci
nixpkgs-ci Bot requested review from Scrumplex and gepbird May 21, 2026 16:06
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment labels May 21, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested a review from av-gal May 21, 2026 16:14

@gepbird gepbird left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Adding a test for this would be nice, it could be the same as in pkgs/test/pnpm/pnpm_11/default.nix but with fetcherVersion = 4. In my opinion we should keep existing tests (which is only one currently) for older fetcherVersions.

@RossSmyth

Copy link
Copy Markdown
Contributor

Forgive my ignorance, and just to double check, but are we certain that the sql dump output is deterministic?

@mkg20001

mkg20001 commented May 21, 2026 •

Copy link
Copy Markdown
Member Author

Forgive my ignorance, and just to double check, but are we certain that the sql dump output is deterministic?

I verified it with openclaw #521248 and didn't have any issues across Linux and mac. Also with autobrr.

@mkg20001

Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 522703 --package autobrr --package tests.pnpm.pnpm_11_v3 --package tests.pnpm.pnpm_11_v4
Commit: 4c84d0a0beeb50076f8d9df5e0bf08db36f620c8


aarch64-darwin

✅ 3 packages built:
  • autobrr
  • tests.pnpm.pnpm_11_v3
  • tests.pnpm.pnpm_11_v4

@mkg20001

Copy link
Copy Markdown
Member Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 522703 --package tests.pnpm.pnpm_11_v3 --package autobrr --package tests.pnpm.pnpm_11_v4
Commit: 4c84d0a0beeb50076f8d9df5e0bf08db36f620c8


x86_64-linux

✅ 3 packages built:
  • autobrr
  • tests.pnpm.pnpm_11_v3
  • tests.pnpm.pnpm_11_v4

@RossSmyth

Copy link
Copy Markdown
Contributor

didn't have any issues across Linux and mac

That's good. Any chance of changes across sqlite versions though? Or changes throughout time?

@mkg20001

Copy link
Copy Markdown
Member Author

didn't have any issues across Linux and mac

That's good. Any chance of changes across sqlite versions though? Or changes throughout time?

Not really something we can prepare for. Less problems than the last implementation. I suppose sqlite dump format is stable enough that we won't see any breakage in the future.

@RossSmyth

Copy link
Copy Markdown
Contributor

Not really something we can prepare for

Sure it is. The first step is knowing whether we need to prepare for it though.

Have you checked with different versions of sqlite? In the dump is there anything that looks like it might be time/date related?

@mkg20001

Copy link
Copy Markdown
Member Author

Have you checked with different versions of sqlite? In the dump is there anything that looks like it might be time/date related?

Oh you mean in the data itself? This is already handled correctly, as we'd have hash issues already beyond the non-determinism from the db's metadata already. Or did you mean something else like order of the data? We can't really sort -n it because it's sql, but the order has been consistent so far, I didn't yet encounter any issues with that. The metadata that could be problematic (like the internal sql version of the db) is specifically removed by the dump step. It doesn't make sense to look at past versions of sqlite that aren't being used in the generation of the dump, as those will never get used. Only future versions remain relevant. Currently, there is only one version of the sqlite tool in nixpkgs.

@RossSmyth

Copy link
Copy Markdown
Contributor

I am aware there is only one version, but if the data has change in the past it may change in the future.

@gepbird

gepbird commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

I am aware there is only one version, but if the data has change in the past it may change in the future.

If the database dump changes after a new pnpm version, it should be caught by nixpkgs-review (which we run for every pnpm update on x86_64-linux, sometimes all packages, sometimes only a few packages break). Then if we can, we'd modify the pnpm-fixup-db-state to produce the older version's hash if possible, otherwise introduce a new pnpm version (like with pnpm_10_29_2 where pnpm broke electron-builder's build script and electron builder STILL hasn't made their fix released in 26.8.2 into their "latest" tag) with pnpm version specefic fetchPnpmDeps changes, or add new fetcherVersion specific changes if we spot issues after the version was merged (or if the changes are unrelated to the pnpm version and/or can be "backported" for older pnpm versions).

I'm not sure how could we improve this workflow or prepare better for upcoming breaking changes (which IMO should be only for major pnpm versions but we even get those for patch releases like #522531).

Sorry for my rants, but I'm somewhat fed up with upstream. This SQLite change is our fault, we should'we tested it on all platforms and shouldnt've assumed that database files are reproducible.

@gepbird

gepbird commented May 22, 2026

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 522703 -p tests.pnpm -p autobrr -p bash-language-server -p n8n
Commit: 4c84d0a0beeb50076f8d9df5e0bf08db36f620c8 (subsequent changes)
Merge: 3d34884e4500005d4baadf082502a0b881b4fcd9

Logs: https://github.com/gepbird/nixpkgs-review-gha/actions/runs/26281290784

Download packages from cache:
  • x86_64-linux
    nix-store -r --add-root nixpkgs-pr-522703-x86_64-linux \
      --option binary-caches 'https://cache.nixos.org/ https://gepbird-nixpkgs-review-gha.cachix.org' \
      --option trusted-public-keys '
      cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
      gepbird-nixpkgs-review-gha.cachix.org-1:DXx7aJqJyRfrgSacf/SSVzEaPbrH3lych7ti/zUBol4=
      ' \
      /nix/store/r4r72c20zv0fmygcqabr5if3x1akm65s-autobrr-1.79.0 \
      /nix/store/mxcirchv78xyig663rvx77rlvfnm2hqd-bash-language-server-5.6.0 \
      /nix/store/b76l1gsc9shfcydgsysggjvqcjjxasf6-n8n-2.20.6 \
      /nix/store/cx8h4fqxrc8hv0ay4wdxd98p3q5car7x-pnpm-empty-lockfile \
      /nix/store/8cqa215w6rx9z99yllr64l0y22fxsp48-pnpm-fixup-state-db-test-salted-8fq27c16qh21 \
      /nix/store/9zfbybj8wjj6dggd1ia0x7ja56j2pxfs-pnpm-test-11.1.2 \
      /nix/store/rig133jkg2b9ng9mn2lp18f19ab23lhl-pnpm-test-11.1.2
  • aarch64-linux
    nix-store -r --add-root nixpkgs-pr-522703-aarch64-linux \
      --option binary-caches 'https://cache.nixos.org/ https://gepbird-nixpkgs-review-gha.cachix.org' \
      --option trusted-public-keys '
      cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
      gepbird-nixpkgs-review-gha.cachix.org-1:DXx7aJqJyRfrgSacf/SSVzEaPbrH3lych7ti/zUBol4=
      ' \
      /nix/store/zw29sg47hlj4wd6hni75sya447ndmx25-autobrr-1.79.0 \
      /nix/store/p4ir59zxj3qc4i14l1px0j3fwgh2as7n-bash-language-server-5.6.0 \
      /nix/store/bys8hrcr2i79nf55a4bmhasad1fldxnx-n8n-2.20.6 \
      /nix/store/gbn3w8jw9ada7h0a2x8ygf2qm4w1r19m-pnpm-empty-lockfile \
      /nix/store/a6xnmnl13wal70i17mdp5qd9z6ds02fn-pnpm-fixup-state-db-test-salted-74ay2yl0a0za \
      /nix/store/4a4cvv9rl2p9fm7hs4i2dxcq50r05jqx-pnpm-test-11.1.2 \
      /nix/store/856fy8zyymfi655m9hhh0i835lp3i1vc-pnpm-test-11.1.2
  • x86_64-darwin
    nix-store -r --add-root nixpkgs-pr-522703-x86_64-darwin \
      --option binary-caches 'https://cache.nixos.org/ https://gepbird-nixpkgs-review-gha.cachix.org' \
      --option trusted-public-keys '
      cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
      gepbird-nixpkgs-review-gha.cachix.org-1:DXx7aJqJyRfrgSacf/SSVzEaPbrH3lych7ti/zUBol4=
      ' \
      /nix/store/68b3g07ybxss7fn2jjb0wwjcq97flrh1-bash-language-server-5.6.0 \
      /nix/store/isvym25v5zcyk2wrai592g5d2h16wcyj-pnpm-test-11.1.2 \
      /nix/store/80v5ykfcpw1hw3m99ynqhbmz309pa4ll-pnpm-test-11.1.2 \
      /nix/store/w09ka9xmnabw8z9lr40l0dafh4p8mhrf-pnpm-empty-lockfile \
      /nix/store/qjy47r97ih84w1anr0kqqc98mv74w961-pnpm-fixup-state-db-test-salted-c3hcp2pc1i75
  • aarch64-darwin
    nix-store -r --add-root nixpkgs-pr-522703-aarch64-darwin \
      --option binary-caches 'https://cache.nixos.org/ https://gepbird-nixpkgs-review-gha.cachix.org' \
      --option trusted-public-keys '
      cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
      gepbird-nixpkgs-review-gha.cachix.org-1:DXx7aJqJyRfrgSacf/SSVzEaPbrH3lych7ti/zUBol4=
      ' \
      /nix/store/8jmj36b0pil26disvsk1r71ly872bhlg-autobrr-1.79.0 \
      /nix/store/pbba99rn8ldxvf8vq68q7b8m7s1pf90n-bash-language-server-5.6.0 \
      /nix/store/jp400l9flciqngnw88ii5i7ax5jp2qq1-pnpm-test-11.1.2 \
      /nix/store/wvy49fv7nif51hl36hw6xx6saa966yj8-pnpm-test-11.1.2 \
      /nix/store/gvdc3q34s2lwn56xp3zg27mkhbb1yx2g-pnpm-empty-lockfile \
      /nix/store/hdv05k7nm5082l15yimy50ikpy74y1ly-pnpm-fixup-state-db-test-salted-qvbpl7sfw0yn

x86_64-linux

✅ 7 packages built:
  • autobrr
  • bash-language-server
  • n8n
  • tests.pnpm.pnpm-empty-lockfile
  • tests.pnpm.pnpm-fixup-state-db
  • tests.pnpm.pnpm_11_v3
  • tests.pnpm.pnpm_11_v4

aarch64-linux

✅ 7 packages built:
  • autobrr
  • bash-language-server
  • n8n
  • tests.pnpm.pnpm-empty-lockfile
  • tests.pnpm.pnpm-fixup-state-db
  • tests.pnpm.pnpm_11_v3
  • tests.pnpm.pnpm_11_v4

x86_64-darwin (sandbox = relaxed)

❌ 2 packages failed to build:
  • autobrr
  • n8n
✅ 5 packages built:
  • bash-language-server
  • tests.pnpm.pnpm-empty-lockfile
  • tests.pnpm.pnpm-fixup-state-db
  • tests.pnpm.pnpm_11_v3
  • tests.pnpm.pnpm_11_v4

Error logs: `x86_64-darwin`
n8n
@n8n/design-system:build: Error: getaddrinfo ENOTFOUND localhost
@n8n/design-system:build:     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:internal/dns/promises:88:17) {
@n8n/design-system:build:   errno: -3008,
@n8n/design-system:build:   code: 'ENOTFOUND',
@n8n/design-system:build:   syscall: 'getaddrinfo',
@n8n/design-system:build:   hostname: 'localhost'
@n8n/design-system:build: }
@n8n/design-system:build:  ELIFECYCLE  Command failed with exit code 1.
n8n-workflow:build:  ELIFECYCLE  Command failed.
 ERROR  @n8n/design-system#build: command (/nix/build/nix-27571-78223883/source/packages/frontend/@n8n/design-system) /nix/store/1gd9q2hpcbdy58n21r8h1k6rzprpwcqb-pnpm-10.33.4/bin/pnpm run build exited (1)

Tasks: 20 successful, 22 total
Cached: 0 cached, 22 total
Time: 1m6.313s
Failed: @n8n/design-system#build

...Finishing writing to cache...                                            

> ...Finishing writing to cache...
ERROR run failed: command exited (1)
 ELIFECYCLE  Command failed with exit code 1.


aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • n8n
✅ 6 packages built:
  • autobrr
  • bash-language-server
  • tests.pnpm.pnpm-empty-lockfile
  • tests.pnpm.pnpm-fixup-state-db
  • tests.pnpm.pnpm_11_v3
  • tests.pnpm.pnpm_11_v4

Error logs: `aarch64-darwin`
n8n
@n8n/design-system:build: Error: getaddrinfo ENOTFOUND localhost
@n8n/design-system:build:     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:internal/dns/promises:88:17) {
@n8n/design-system:build:   errno: -3008,
@n8n/design-system:build:   code: 'ENOTFOUND',
@n8n/design-system:build:   syscall: 'getaddrinfo',
@n8n/design-system:build:   hostname: 'localhost'
@n8n/design-system:build: }
@n8n/design-system:build:  ELIFECYCLE  Command failed with exit code 1.
@n8n/expression-runtime:build:  ELIFECYCLE  Command failed.
 ERROR  @n8n/design-system#build: command (/nix/build/nix-49284-1304224823/source/packages/frontend/@n8n/design-system) /nix/store/3ygfga6470hpqzxkid2jnh50ikzr4b26-pnpm-10.33.4/bin/pnpm run build exited (1)

Tasks: 19 successful, 21 total
Cached: 0 cached, 21 total
Time: 31.068s
Failed: @n8n/design-system#build

...Finishing writing to cache...                                            

> ...Finishing writing to cache...
ERROR run failed: command exited (1)
 ELIFECYCLE  Command failed with exit code 1.

@gepbird

gepbird commented May 22, 2026

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 522703 -p n8n -p autobrr
Commit: 4c84d0a0beeb50076f8d9df5e0bf08db36f620c8 (subsequent changes)
Merge: 3d34884e4500005d4baadf082502a0b881b4fcd9

Logs: https://github.com/gepbird/nixpkgs-review-gha/actions/runs/26283163263


x86_64-darwin (sandbox = false)

❌ 2 packages failed to build:
  • autobrr
  • n8n

Error logs: `x86_64-darwin`
n8n
n8n:build:  5: 0x102bb57e7 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1::operator()() const [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build:  6: 0x102bb506d void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_1>(heap::base::Stack*, void*, void const*) [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build:  7: 0x10368fea8 PushAllRegistersAndIterateStack [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build:  8: 0x102b9a128 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build:  9: 0x102b8c9c9 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build: 10: 0x102b68b37 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build: 11: 0x1030c0f6a v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build: 12: 0x103766836 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/nix/store/jni6dbiv7ihywbp70zix5g8nx9akmcn3-nodejs-slim-24.15.0/bin/node]
n8n:build:  ELIFECYCLE  Command failed with exit code 134.
 ERROR  n8n#build: command (/nix/build/nix-6780-1876986994/source/packages/cli) /nix/store/1gd9q2hpcbdy58n21r8h1k6rzprpwcqb-pnpm-10.33.4/bin/pnpm run build exited (134)

Tasks: 43 successful, 44 total
Cached: 0 cached, 44 total
Time: 10m46.543s
Failed: n8n#build

...Finishing writing to cache...                                            

> ...Finishing writing to cache...
ERROR run failed: command exited (134)
 ELIFECYCLE  Command failed with exit code 134.


aarch64-darwin (sandbox = false)

❌ 2 packages failed to build:
  • autobrr
  • n8n

Error logs: `aarch64-darwin`
n8n
n8n:build: 240: 0x1008ccd34 node::builtins::BuiltinLoader::CompileAndCall(v8::Local<v8::Context>, char const*, node::Realm*) [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 241: 0x1009b3554 node::Realm::ExecuteBootstrapper(char const*) [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 242: 0x1008a28bc node::StartExecution(node::Environment*, char const*) [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 243: 0x1008a282c node::StartExecution(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfoWithModule const&)>) [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 244: 0x1007e7e94 node::LoadEnvironment(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfoWithModule const&)>, std::__1::function<void (node::Environment*, v8::Local<v8::Value>, v8::Local<v8::Value>)>) [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 245: 0x10095c61c node::NodeMainInstance::Run() [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 246: 0x1008a6c44 node::Start(int, char**) [/nix/store/4366l8b6kz1f2sxq6243rfs53grc73zz-nodejs-slim-24.15.0/bin/node]
n8n:build: 247: 0x1844e2b98 start [/usr/lib/dyld]
n8n:build:  ELIFECYCLE  Command failed with exit code 134.
 ERROR  n8n#build: command (/nix/build/nix-3427-168700643/source/packages/cli) /nix/store/3ygfga6470hpqzxkid2jnh50ikzr4b26-pnpm-10.33.4/bin/pnpm run build exited (134)

Tasks: 43 successful, 44 total
Cached: 0 cached, 44 total
Time: 6m13.449s
Failed: n8n#build

...Finishing writing to cache...                                            

> ...Finishing writing to cache...
ERROR run failed: command exited (134)
 ELIFECYCLE  Command failed with exit code 134.

@gepbird

gepbird commented May 23, 2026

Copy link
Copy Markdown
Contributor

Weird that autobrr fails on darwin, could it be an issue with the GHA runner? Can someone test it on a real darwin machine?

On the GHA build it fails before reaching the changed lines in this PR:

end of autobrr logs
2026-05-22T10:48:15.3021840Z autobrr-web-pnpm-deps> /nix/store/0y3vzjqz42dmyasywgr6ipcfb0nwdzvy-stdenv-darwin/setup: line 1827:  4628 Abort trap: 6              pnpm install --force --ignore-scripts --registry="$NIX_NPM_REGISTRY" --frozen-lockfile
2026-05-22T10:48:34.6122700Z error: Cannot build '/nix/store/bqa246qv6wllgkxs99s86by95x2n82aw-autobrr-web-pnpm-deps.drv'.
2026-05-22T10:48:34.6124310Z        Reason: builder failed with exit code 134.
2026-05-22T10:48:34.6125080Z        Output paths:
2026-05-22T10:48:34.6126610Z          /nix/store/pfmli4mfwfnhwy5xh7hc1c7c8d65j9in-autobrr-web-pnpm-deps
2026-05-22T10:48:34.6127800Z        Last 25 log lines:
2026-05-22T10:48:34.6128350Z        > + react-select 5.10.2
2026-05-22T10:48:34.6128940Z        > + react-textarea-autosize 8.5.9
2026-05-22T10:48:34.6129500Z        > + stacktracey 2.2.0
2026-05-22T10:48:34.6130150Z        > + tailwind-lerp-colors 1.2.6
2026-05-22T10:48:34.6130790Z        > + tailwindcss 4.2.4
2026-05-22T10:48:34.6131390Z        > + workbox-window 7.4.0
2026-05-22T10:48:34.6132060Z        > + zod 4.4.1
2026-05-22T10:48:34.6132590Z        > + zod-formik-adapter 2.0.0
2026-05-22T10:48:34.6133300Z        >
2026-05-22T10:48:34.6133770Z        > devDependencies:
2026-05-22T10:48:34.6134390Z        > + @eslint/js 10.0.1
2026-05-22T10:48:34.6134950Z        > + @rollup/wasm-node 4.60.2
2026-05-22T10:48:34.6135550Z        > + eslint 10.3.0
2026-05-22T10:48:34.6136110Z        > + eslint-plugin-import 2.32.0
2026-05-22T10:48:34.6138390Z        > + eslint-plugin-react 7.37.5
2026-05-22T10:48:34.6139150Z        > + eslint-plugin-react-hooks 7.1.1
2026-05-22T10:48:34.6139820Z        > + eslint-plugin-react-refresh 0.5.2
2026-05-22T10:48:34.6140620Z        > + eslint-watch 8.0.0
2026-05-22T10:48:34.6141220Z        > + globals 17.5.0
2026-05-22T10:48:34.6141790Z        > + ts-node 10.9.2
2026-05-22T10:48:34.6142400Z        > + typescript 6.0.3
2026-05-22T10:48:34.6143120Z        > + vite 8.0.10
2026-05-22T10:48:34.6143710Z        > + vite-plugin-pwa 1.2.0
2026-05-22T10:48:34.6144300Z        > + vite-plugin-svgr 5.2.0
2026-05-22T10:48:34.6146280Z        > /nix/store/0y3vzjqz42dmyasywgr6ipcfb0nwdzvy-stdenv-darwin/setup: line 1827:  4628 Abort trap: 6              pnpm install --force --ignore-scripts --registry="$NIX_NPM_REGISTRY" --frozen-lockfile
2026-05-22T10:48:34.6147540Z        For full logs, run:
2026-05-22T10:48:34.6147920Z          nix log /nix/store/bqa246qv6wllgkxs99s86by95x2n82aw-autobrr-web-pnpm-deps.drv
2026-05-22T10:48:34.6155260Z error: Cannot build '/nix/store/5k8a3kbg4jibm9ds66qg144hfbsgfl77-autobrr-web-1.79.0.drv'.
2026-05-22T10:48:34.6156810Z        Reason: 1 dependency failed.
2026-05-22T10:48:34.6157460Z        Output paths:
2026-05-22T10:48:34.6158450Z          /nix/store/hlgv0hqbal7bkhrxxgaj3ss9k53f0fx9-autobrr-web-1.79.0
2026-05-22T10:48:34.6166110Z error: Build failed due to failed dependency
2026-05-22T10:48:34.6167640Z error: Cannot build '/nix/store/g9pvza1krshbj2s4qa7wyw48byhdniws-autobrr-1.79.0.drv'.
2026-05-22T10:48:34.6168860Z        Reason: 1 dependency failed.
2026-05-22T10:48:34.6169460Z        Output paths:
2026-05-22T10:48:34.6170200Z          /nix/store/8jmj36b0pil26disvsk1r71ly872bhlg-autobrr-1.79.0
2026-05-22T10:48:34.6171070Z error: Build failed due to failed dependency

But passes on Hydra: https://hydra.nixos.org/build/329256136#tabs-summary

Also in both cases it generates a large number of repeating warning logs: https://cache.nixos.org/log/yzgp82np1glqbszywamblgh5iwcm5c9k-autobrr-web-1.79.0.drv

@gepbird gepbird left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff looks good, n8n was most likely already failing while autobrr passed once and failed once (without reaching the lines touched by this PR) on darwin.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels May 23, 2026
@mkg20001

Copy link
Copy Markdown
Member Author

My attempt #522703 (comment) was on a real darwin with sandbox relaxed, other modes (including off) cause the crash

@Scrumplex
Scrumplex added this pull request to the merge queue May 23, 2026
mkg20001 added 2 commits May 23, 2026 22:13
Make the fetcher version explicit in the test name in preparation for
adding a v4 test.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests the SQLite dump/reconstruct code path introduced in fetcherVersion 4,
which ensures reproducibility of the pnpm v11 store index.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Scrumplex
Scrumplex added this pull request to the merge queue May 24, 2026
Merged via the queue into NixOS:master with commit f967915 May 24, 2026
26 checks passed
@mkg20001
mkg20001 deleted the fix/pnpm-sqlite branch May 24, 2026 14:19
@SuperSandro2000

Copy link
Copy Markdown
Member

Do we need to backport this to 26.05?

@diogotcorreia

Copy link
Copy Markdown
Member

@SuperSandro2000 I'd say we should, as pnpm v11 is the default in 26.05.

Adding the label

@diogotcorreia diogotcorreia added the backport release-26.05 Backport PR automatically label May 25, 2026
@nixpkgs-ci

nixpkgs-ci Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Backport failed for release-26.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-26.05
git worktree add -d .worktree/backport-522703-to-release-26.05 origin/release-26.05
cd .worktree/backport-522703-to-release-26.05
git switch --create backport-522703-to-release-26.05
git cherry-pick -x f2ba699f37b4630d0502dfa024f3c1ffb2efab22 8255b29ce1198b4c2f432e483c59f215409852cb f09853e8b794e011bf2d24fef85a5cc0335a8911 6f776474958a15c60ba61c82772e71dc2f6d23ae

@Scrumplex

Copy link
Copy Markdown
Member

This was merged before branch-off it seems :D

See https://github.com/NixOS/nixpkgs/commits/release-26.05/pkgs/build-support/node/fetch-pnpm-deps

@hsjobeki

hsjobeki commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

It seems this changes existing build time FOD hashes. Just noticed this while upgrading a project to 26.05.

I suspect people will now have stale FOD hashes and they wouldn't notice since they are already cached and wont get invalidated. Invalidation of an FOD happens through two mechanisms: "hash" eval-value changes, or "name" eval-value changes.

I'm not sure if this was considered; But if this changes the build time hash, without changing the FOD eval-name. people and hydra has stale fod-derivations now.

@diogotcorreia

Copy link
Copy Markdown
Member

@hsjobeki Have you bisected? I don't think this PR is the reason for stale hashes, as the changes are gated behind a new fetcherVersion. I had the same thing happen on projects I packaged out-of-tree and the culprit is the upgrade from pnpm 10 to pnpm 11.

You can pass pnpm = pnpm_10 to fetchPnpmDeps to fix this.

@hsjobeki hsjobeki mentioned this pull request May 28, 2026
4 of 13 tasks
@hsjobeki

hsjobeki commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

😮‍💨 spent the last 1 hr bisecting now ^^

Seems #505103 is the actual source of the breakage.

As per my comment there this is an architectural problem of complex fod-fetchers. Any change of the build-script can lead to new output hashes.
I think its better to add invalidation mechanism on every build-script change rather than breaking silently.

@emilazy

emilazy commented Jul 5, 2026

Copy link
Copy Markdown
Member

This has now broken FOD hashes because of a SQLite update, as predicted.

@gepbird

gepbird commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This has now broken FOD hashes because of a SQLite update, as predicted.

Can you expand on this? I've tried rebuilding a random pnpm 11 package's (your_spotify's) pnpmDeps attribute that is using fetcherVersion = 4 and it passed, so it correctly gave the same hash.
With fetcherVersion = 3 we stored the SQLite DB in the FOD that caused hash mismatches, that's why we're only storing a DB dump in fetcherVersion = 4.

@diogotcorreia

diogotcorreia commented Jul 5, 2026 •

Copy link
Copy Markdown
Member

@gepbird There is currently a discussion on Matrix #staging:nixos.org.

It's broken on staging-next following an update of SQLite from 3.51.2 to 3.53.1.

EDIT:
Uploading diff from Matrix so it's easier:
image

Credits to @K900 for the screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. backport release-26.05 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants