fix(nix/desktop): electron.headers + offline nix-build guard (.#web/.#tui/.#desktop) - #53202
fix(nix/desktop): electron.headers + offline nix-build guard (.#web/.#tui/.#desktop)#53202ak2k wants to merge 2 commits into
Conversation
3b4ffee to
b9493ba
Compare
ab0116d to
5284e11
Compare
|
Thanks for the durable Nix fix and regression guard. The reported defect is still present on current main: The proposed Automated hermes-sweeper review. |
|
Heads-up that
Both are exactly the "merges green under Docker/ |
|
God bless u |
|
Additional data point: this breaks for consumers whose nixpkgs resolves a different electron We hit this downstream. Worth adding a second framing, because the current one ("breaks on every nixpkgs electron bump") reads as latent — your CI is green, so nothing looks urgent. The sharper version: Your The URL templates off
|
hermes-desktop's renderer compiled node-pty against a hand-pinned fetchurl of Electron's node headers, whose URL is templated off electron.version but whose sha256 was hardcoded. Every nixpkgs electron bump swaps the tarball out from under that pinned hash, failing the fixed-output derivation at build time — and only there, never in the networked Docker/npm ci paths. nixpkgs recently resolved electron to 41.9.1, breaking the build for every Nix consumer. Use nixpkgs' own electron.headers derivation instead. It is version-locked to the electron package, so it tracks every bump automatically with no hand-pinned hash to go stale, needs no network, and is already the --nodedir layout (so the manual fetch + tar extraction both go away). Same pattern as signal-desktop, github-desktop, session-desktop, rstudio in nixpkgs.
No workflow built the flake offline before this (the nix-setup composite existed but nothing called it), so two classes of regression could merge green while breaking downstream Nix consumers: a package-lock.json that an incremental npm install pruned platform-optional packages from (fails the offline importNpmLock build of .#web/.#tui), and a desktop native-compile break like the electron.headers hash this PR also fixes. Add a nix-build workflow that runs `nix build .#web .#tui .#desktop` offline, gated on a new `nix` lane (nix/, flake.nix, flake.lock) OR the frontend lane (package-lock.json / web / ui-tui / apps), and require it in the all-checks gate.
5284e11 to
08d4cb0
Compare
|
Rebased onto current Conflicts were confined to the CI scaffolding; I also A/B'd the fix against the failure it prevents. Both arms pinned to the same nixpkgs (
So One honest note on the guard's scope, since it's the half this PR uniquely adds: it would not have caught the consumer breakage I reported above, because CI only ever builds against this repo's own lock, where the hardcoded hash is correct by construction. What it does catch is the next time nixpkgs moves |
Rebased onto current
mainand expanded from the original web/tui guard into a self-contained fix + guard. Two commits:fix(nix/desktop): compile node-pty against electron.headersThe desktop renderer compiled node-pty against a hand-pinned
fetchurlof Electron's node headers — URL templated offelectron.version, butsha256hardcoded. Every nixpkgselectronbump swaps the tarball out from under the pinned hash, failing the fixed-output derivation only at build time (the networked Docker /npm cipaths never see it). nixpkgs recently resolvedelectron→ 41.9.1, breaking.#desktopfor every Nix consumer:Fix: use nixpkgs' own
electron.headersderivation (--nodedir=${electron.headers}). It's version-locked to theelectronpackage, so it tracks every bump automatically — no hand-pinned hash to go stale, no network, and it's already the--nodedirlayout (the manualfetchurl+tarboth go away). Same pattern assignal-desktop,github-desktop,session-desktop,rstudioin nixpkgs. Closes #61443.Verified:
nix build .#desktopsucceeds on aarch64-darwin with electron 41.9.1 (node-pty native binary compiles + stages).ci(nix): offline nix-build guard for .#web/.#tui/.#desktopNo workflow built the flake offline before this (
nix-setupexisted but nothing called it), so two regression classes could merge green while breaking Nix consumers:.#web/.#tuibuild viaimportNpmLock(offline, no network), so apackage-lock.jsonmissing a platform-optional package (e.g. an incremental macOSnpm installpruning@esbuild/<platform>) fails here even though Docker/npm cisucceed.Adds a
nix-buildworkflow runningnix build .#web .#tui .#desktopoffline, gated on a newnixlane (nix/,flake.nix,flake.lock) or thefrontendlane, and required in theall-checks-passgate. Classifier tests updated (23 pass).