Skip to content

fix(nix): use electron.headers instead of hardcoded headers hash in desktop.nix - #69458

Draft
alt-glitch wants to merge 2 commits into
mainfrom
fix/desktop-electron-headers
Draft

fix(nix): use electron.headers instead of hardcoded headers hash in desktop.nix#69458
alt-glitch wants to merge 2 commits into
mainfrom
fix/desktop-electron-headers

Conversation

@alt-glitch

@alt-glitch alt-glitch commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Salvage of #61824 by @fkz (commit cherry-picked, authorship preserved). Prior art: #53202 by @ak2k contains the identical electron.headers change and predates #61824 — credit to both; #53202's separate CI-lane component is superseded by the trigger-only nix CI in #69463 (its offline-build guard scope is covered by scripts/nix-ci.sh build).

nix/desktop.nix pinned the Electron node-headers tarball via fetchurl with a hardcoded sha256. Because electron.version comes from nixpkgs, every nixpkgs Electron bump changes the URL and breaks .#desktop with a fixed-output hash mismatch (#61443). nixpkgs' electron already exposes the matching headers as electron.headers, so this deletes the fetchurl entirely and points npm rebuild node-pty --nodedir at it.

Verified today: bumping the flake's nixpkgs (2026-04-01 → 2026-07-19) moves Electron 41.0.2 → 41.9.1 and reproduces the hash mismatch on current main; with this change .#desktop builds green on both pins.

Closes #61443. Supersedes #61824 and the desktop.nix half of #53202.

Test plan

  • nix build .#desktop on current flake.lock (Electron 41.0.2) — passes
  • nix build .#desktop with nixpkgs 241313f4 (Electron 41.9.1) — passes (was: hash mismatch)

…op.nix

Remove hardcoded hash and use electron.headers directly instead.

Fixes #61443
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

running on a8be142

looks good to me!

@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/*) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 22, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Nine PRs reference or overlap this issue complex. #53202, #61824, and #69458 remove the independently pinned Electron-header fetch in favor of electron.headers; #61530, #72121, and merged #76295 only replace one fixed hash, while #37234, #38253, and #43961 change adjacent desktop packaging behavior without altering header acquisition.

Related pull requests

Duplicates

#61824 and #69458 implement the same electron.headers repair, with #69458 explicitly salvaging #61824; that repair also overlaps the desktop portion of broader #53202. #61530 and #72121 are identical Electron-41.9.1 hash bumps, while merged #76295 uses the same one-version fixed-hash strategy with a different hash; #37234, #38253, and #43961 are adjacent changes, not duplicates of the header repair.

Suggested consolidation

Keep #69458 open with the concrete salvage path of retaining its focused, attributed electron.headers repair; this respects its recorded best-fix findings without issuing a merge recommendation. For #53202, whose recorded best-fix findings and keep_open verdict are supported by its distinct offline guard, request author action to rebase onto main or split out the still-applicable CI component; close #61824 as duplicate of the salvaged implementation in #69458, leave #61530 and #72121 closed as superseded one-version stopgaps, and keep #38253 and #43961 on their separately reviewed salvage paths.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    I61443(["issue #61443 (open)"])
    I72095(["issue #72095 (open)"])
    subgraph Dup53202 ["PRs duplicating each other"]
        P53202["PR #53202 (open)"]
        P61824["PR #61824 (open)"]
        P69458["PR #69458 (open)"]
    end
    P69458 -->|best fix| I61443
    P69458 -->|best fix| I72095
    class I61443 open
    class I72095 open
    class P53202 open
    class P61824 open
    class P69458 open
    class P53202 best
    class P53202 best
    class P69458 best
    class P69458 best
    class P69458 target
    click I61443 "https://github.com/NousResearch/hermes-agent/issues/61443"
    click I72095 "https://github.com/NousResearch/hermes-agent/issues/72095"
    click P53202 "https://github.com/NousResearch/hermes-agent/pull/53202"
    click P61824 "https://github.com/NousResearch/hermes-agent/pull/61824"
    click P69458 "https://github.com/NousResearch/hermes-agent/pull/69458"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 9 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 31 kB of PR diffs, 28 kB of issue/PR text, 15 kB of discussion (21 comments), 18 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@alt-glitch

Copy link
Copy Markdown
Collaborator Author

Call-graph-assisted review — Nix-only change, so calldiff doesn't apply; reviewed via git diff, the surrounding build recipe, and the file's git history.

Replaces the hand-pinned electronHeaders = pkgs.fetchurl { … sha256 = "…"; } with nixpkgs' own ${electron.headers}, and drops the now-unnecessary mkdir/tar -xzf extraction step, wiring --nodedir="${electron.headers}" straight into the npm rebuild node-pty call. This is a genuinely good fix, not just a cleanup.

✅ Looks good

  • Kills a recurring maintenance class. git log -- nix/desktop.nix shows a trail of fix(nix): update electron sha, fix(nix): fix electron headers sha, fix(nix): update electron headers sha — the hardcoded hash had to be manually re-pinned every time the nixpkgs electron version moved, and a stale hash breaks the desktop build outright. electron.headers is version-matched to the same electron derivation by construction, so the hash can never drift out of sync again. This is exactly the "fix the whole bug class, not the one instance" pattern.
  • Removing the tar extraction to $TMPDIR/electron-headers also removes a build-time side effect and a hand-rolled temp dir; electron.headers is a store path node-gyp can read directly.
  • --disturl="" and --offline are correctly retained, so no network access is reintroduced into the sandboxed build.

🟡 Duplication / abstraction

🔴 Issues

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: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)

3 participants