Skip to content

fix(desktop): bump electron node-headers sha256 to match pinned electron.version - #61530

Closed
jackjin1997 wants to merge 1 commit into
NousResearch:mainfrom
jackjin1997:fix/desktop-nix-electron-headers-hash
Closed

jackjin1997 wants to merge 1 commit into
NousResearch:mainfrom
jackjin1997:fix/desktop-nix-electron-headers-hash

Conversation

@jackjin1997

Copy link
Copy Markdown
Contributor

What does this PR do?

electronHeaders in nix/desktop.nix fetches from a URL templated off electron.version, but its sha256 was hardcoded to a prior electron release. nixpkgs-nixos-unstable now resolves electron to 41.9.1, so the URL and the pinned hash have desynced and the fixed-output derivation fails with a hash mismatch — nix build .#desktop is broken.

This only surfaces at Nix build time; the networked Docker / npm ci paths are unaffected, which is why it merged green in the first place. The reported hash mismatch error includes the actual sha256 Nix computed for the 41.9.1 tarball (got: line), so this bump uses that first-party value rather than a guess.

Related Issue

Fixes #61443

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • nix/desktop.nix: bump electronHeaders.sha256 from the stale pinned-electron-version hash to the hash Nix reported for the current electron.version (41.9.1), with a comment noting it needs to move in lockstep with electron.version going forward.

How to Test

  1. nix build .#desktop on current main fails with:
    error: hash mismatch in fixed-output derivation 'node-v41.9.1-headers.tar.gz.drv':
      specified: sha256-zi/QMwRZ0+FwE9XTE+DiSIeJXAwxmLKEaBWD5W3pMOI=
           got:  sha256-zOl8rx6woWh7aeRUOlkTMviKc/EAQQX6nr/MxAx1ZPI=
    
  2. With this PR's sha256 value, the fixed-output derivation matches and the build proceeds past the electronHeaders fetch.

I don't have a local Nix toolchain in this environment to run nix build .#desktop myself, so I can't attach a green build log — the fix is the exact got: value from the issue's own Nix error trace, not a derived/guessed one. Flagging this so a maintainer or reviewer with Nix available can do the final confirm; happy to iterate if the value needs adjusting for a different platform's tarball.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs (by issue number and by file/mechanism) to make sure this isn't a duplicate
  • My PR contains only changes related to this fix (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass — N/A, this is a Nix-only data value change with no Python test surface, and I don't have a local Nix toolchain to run nix build in this environment (see note above)
  • I've added tests for my changes — N/A, no pytest-testable surface for this change; the issue notes fix(nix/desktop): electron.headers + offline nix-build guard (.#web/.#tui/.#desktop) #53202 extends the offline nix-build CI guard to .#desktop, which is what will catch this class going forward
  • I've tested on my platform: macOS 15 (Darwin) — verified via git show origin/main:nix/desktop.nix that the current hash/URL mismatch matches the issue description exactly; did not run nix build (no local Nix)

Documentation & Housekeeping

  • N/A — no docs, config keys, or tool schemas changed

AI Disclosure

This bug was identified and fixed with AI assistance.

…ron.version

electronHeaders fetches from a URL templated off electron.version, but the
sha256 was hardcoded to a prior electron release. nixpkgs-nixos-unstable now
resolves electron to 41.9.1, so the fixed-output derivation hash-mismatches
and `nix build .#desktop` fails.

Fixes NousResearch#61443
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/nix Nix flake, NixOS module, container packaging comp/desktop Electron desktop app (apps/desktop/*) labels Jul 9, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Related: fixes #61443 (.#desktop build breaks on every nixpkgs electron bump because electronHeaders.sha256 in nix/desktop.nix is hardcoded while its URL follows electron.version). Same recurring fixed-output-derivation hash-drift family as #48883. Note the bumped hash is the first-party got: value from the issue's Nix error; a reviewer with a local Nix toolchain should confirm nix build .#desktop goes green, and a durable fix (deriving the hash from electron.version with a loud assertion) would stop this recurring on the next bump.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused fix. Current main still derives the Electron-header URL from electron.version while retaining the prior fixed hash at nix/desktop.nix:29-31; PR #61530 changes only that stale value to the hash recorded by Nix in #61443.

The related durable alternative, #61824, is still open, so it does not supersede this immediate repair on main.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users labels Jul 11, 2026
@ak2k

ak2k commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Related: #53202 (2026-06-26) fixes the same break durably — it replaces the hand-pinned fetchurl with nixpkgs' electron.headers (version-locked to electron, so no hash to bump on future electron updates) and adds an offline nix-build CI lane so this class of break fails in CI instead of merging green. The hash bump here would need repeating on every nixpkgs electron bump.

@jackjin1997

Copy link
Copy Markdown
Contributor Author

Thanks for flagging this — #53202 has since been expanded to replace the hand-pinned fetchurl with nixpkgs' electron.headers (version-locked, no hash to bump on future electron bumps) plus an offline nix-build CI guard covering .#desktop, and #61824 is also refactoring this same spot. My hash bump is a strictly narrower stopgap than either — closing in favor of #53202's durable fix.

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

Labels

area/nix Nix flake, NixOS module, container packaging comp/desktop Electron desktop app (apps/desktop/*) P2 Medium — degraded but workaround exists sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nix: .#desktop build breaks on every nixpkgs electron bump (hardcoded node-headers hash)

4 participants