Download arch-matched dmg in unsigned macOS manual-update path#18
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On ad-hoc-signed macOS builds we bypass Squirrel.Mac and download the update dmg ourselves (
downloadForManualInstall). It picked the artifact withinfo.files?.[0]?.url— the first entry inlatest-mac.yml.That list is not arch-filtered: the
update-availableevent 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: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.archgives the running app's arch.app.runningUnderARM64Translationoverrides it toarm64when an x64 build is already stuck under Rosetta, so it self-heals to the native arm64 build on the next update.files[0], then to a synthesized name, if no match.🤖 Generated with Claude Code