Skip to content

Download arch-matched dmg in unsigned macOS manual-update path#18

Merged
danipen merged 1 commit into
mainfrom
fix-macos-manual-update-arch
Jun 3, 2026
Merged

Download arch-matched dmg in unsigned macOS manual-update path#18
danipen merged 1 commit into
mainfrom
fix-macos-manual-update-arch

Conversation

@danipen

@danipen danipen commented Jun 3, 2026

Copy link
Copy Markdown
Owner

The bug

On ad-hoc-signed macOS builds we bypass Squirrel.Mac and download the update dmg ourselves (downloadForManualInstall). It picked the artifact with info.files?.[0]?.url — the first entry in latest-mac.yml.

That list is not arch-filtered: the update-available event hands us every arch's artifacts, and electron-updater only narrows the list by arch inside the Squirrel download path we deliberately skip. The first entry is whichever arch built first — x64:

files:
  - url: GitGrove-1.0.4-macOS-x64.zip      # <- files[0], always picked
  - url: GitGrove-1.0.4-macOS-arm64.zip
  ...

So every unsigned Mac — Apple Silicon included — downloaded the Intel dmg, then ran the whole app under Rosetta. That's the "everything is super slow" symptom.

The fix

Select the artifact whose filename carries the host arch token (-macOS-arm64.zip / -macOS-x64.zip):

  • process.arch gives the running app's arch.
  • app.runningUnderARM64Translation overrides it to arm64 when an x64 build is already stuck under Rosetta, so it self-heals to the native arm64 build on the next update.
  • Falls back to files[0], then to a synthesized name, if no match.

🤖 Generated with Claude Code

In manualMode (ad-hoc-signed macOS), downloadForManualInstall took
info.files[0] as the artifact to fetch. The update-available event hands
us the full latest-mac.yml file list unfiltered — electron-updater only
narrows it by arch inside the Squirrel download path we deliberately
bypass — and files[0] is whichever arch built first (x64). So every
unsigned Mac, Apple Silicon included, downloaded the Intel dmg and ran
the whole app under Rosetta, making everything slow.

Select the artifact matching the host arch via the explicit arch token
in our filenames. Use app.runningUnderARM64Translation so an x64 build
already stuck under Rosetta self-heals to native arm64 on next update.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danipen danipen merged commit 1ff3a04 into main Jun 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant