Skip to content

fix(macos-tray): download DMG matching host CPU architecture#377

Merged
Dumbris merged 1 commit intomainfrom
fix/tray-update-arch-selection
Apr 11, 2026
Merged

fix(macos-tray): download DMG matching host CPU architecture#377
Dumbris merged 1 commit intomainfrom
fix/tray-update-arch-selection

Conversation

@Dumbris
Copy link
Copy Markdown
Member

@Dumbris Dumbris commented Apr 11, 2026

Summary

  • The macOS tray's "Download update" menu item always opened the first darwin DMG found in the GitHub release assets. Because amd64 sorts before arm64, Apple Silicon users were pushed toward the Intel installer.
  • Detect the host architecture via sysctl (with Rosetta handling so a translated process still gets offered the native arm64 DMG), match release assets on both darwin and the arch token, and prefer the signed/notarized -installer.dmg variant when present.

Root cause

UpdateService.checkWithGitHub() iterated assets and took the first entry matching name.contains("darwin") && name.hasSuffix(".dmg"). Release assets published by .github/workflows/release.yml include both darwin-amd64 and darwin-arm64 variants (plus -installer.dmg signed/notarized variants), and the iteration always landed on the Intel build.

Fix

native/macos/MCPProxy/MCPProxy/Services/UpdateService.swift:

  • New hostArchToken() static helper returns "arm64" / "amd64", checking sysctl.proc_translated first (so Intel binaries under Rosetta 2 still return arm64) then reading hw.machine.
  • Asset selector now filters on darwin + the arch token + .dmg, and prefers -installer.dmg (signed + notarized) when both signed and unsigned variants exist for the arch.

Test plan

  • swiftc build of MCPProxy target succeeds (only pre-existing Sendable warnings remain).
  • On an Apple Silicon host, trigger "Check for updates" → verify the download URL contains darwin-arm64-installer.dmg.
  • On an Intel host (or Rosetta-disabled VM), verify the URL contains darwin-amd64-installer.dmg.
  • On an Apple Silicon host running the tray binary under Rosetta, verify it still resolves to the arm64 DMG.

🤖 Generated with Claude Code

The "Download update" menu item always opened the first darwin DMG
found in the GitHub release assets, which is the amd64 build on any
release (amd64 sorts before arm64). Apple Silicon users were pushed
toward the Intel installer.

Detect the host architecture via sysctl (handling Rosetta translation
so a translated process still gets offered the native arm64 DMG),
match release assets on both "darwin" and the arch token, and prefer
the signed/notarized "-installer.dmg" variant when present.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6a295bf
Status: ✅  Deploy successful!
Preview URL: https://4ef132bd.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-tray-update-arch-selecti.mcpproxy-docs.pages.dev

View logs

@github-actions
Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/tray-update-arch-selection

Available Artifacts

  • archive-darwin-amd64 (26 MB)
  • archive-darwin-arm64 (23 MB)
  • archive-linux-amd64 (15 MB)
  • archive-linux-arm64 (13 MB)
  • archive-windows-amd64 (25 MB)
  • archive-windows-arm64 (23 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (19 MB)
  • installer-dmg-darwin-arm64 (17 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 24283195942 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit 4dad6d1 into main Apr 11, 2026
23 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.

2 participants