Skip to content

fix(desktop): ship universal native helpers so capture runs on Intel Macs - #1

Draft
mustafaksaeed wants to merge 1 commit into
mainfrom
fix/universal-native-binaries
Draft

fix(desktop): ship universal native helpers so capture runs on Intel Macs#1
mustafaksaeed wants to merge 1 commit into
mainfrom
fix/universal-native-binaries

Conversation

@mustafaksaeed

Copy link
Copy Markdown
Collaborator

Summary

The desktop app's native macOS helpers — screen-recorder, cursor-monitor, and window-detector — were committed as arm64-only binaries. On an Intel (x86_64) Mac, every spawn of these helpers failed with EBADARCH (errno -86, "Bad CPU type in executable"), which broke screen recording and screenshot capture entirely:

screenshot capture failed: spawn Unknown system error -86

This rebuilds all three helpers as universal binaries (x86_64 + arm64) so the desktop app runs on both Intel and Apple Silicon. The arm64 slice is preserved, so Apple Silicon behavior is unchanged.

Changes

  • apps/desktop/native/screen-recorder/bin/screen-recorder → universal
  • apps/desktop/native/cursor-monitor/bin/cursor-monitor → universal
  • apps/desktop/native/window-detector/bin/window-detector → universal

Rebuilt from source with the installed Swift toolchain, e.g.:

cd apps/desktop/native/screen-recorder
swiftc -O -target x86_64-apple-macos13.2 RecordingWriter.swift spikes/RecordingTapSpike.swift main.swift -o /tmp/x64
swiftc -O -target arm64-apple-macos13.2  RecordingWriter.swift spikes/RecordingTapSpike.swift main.swift -o /tmp/arm
lipo -create /tmp/x64 /tmp/arm -output bin/screen-recorder

(cursor-monitor and window-detector are single-file swiftc builds.)

Local-dev setup notes (not in this PR — files are gitignored)

Getting a fresh clone running end-to-end on next dev (port 3032) also required local-only config that can't be committed:

  • apps/web/.dev.varsBETTER_AUTH_SECRET (openssl rand -hex 32) and BETTER_AUTH_URL=http://localhost:3032 (fixes Invalid origin / Base URL could not be determined on signup).
  • apps/web/.env.localNEXT_PUBLIC_R2_PUBLIC_BASE_URL=http://localhost:3032/api/r/media so the client loads media through the local proxy instead of the prod CDN (fixes black thumbnails + "bucket may have lost CORS access" in the editor).
  • pnpm --filter @captureflow/web db:seed:local to seed local D1.

Note: apps/web/.dev.vars.example documents http://localhost:3000, but next dev actually runs on 3032 (next dev -p 3032) — worth aligning in a follow-up.

Test plan

  • On an Intel Mac, launch the desktop app and confirm recording + screenshot capture succeed (no spawn Unknown system error -86).
  • On Apple Silicon, confirm capture still works (arm64 slice).
  • Verify file apps/desktop/native/*/bin/* reports universal binary with 2 architectures.

…Macs

The screen-recorder, cursor-monitor, and window-detector Swift helpers were
committed as arm64-only, so on Intel (x86_64) Macs every spawn failed with
EBADARCH (errno -86 / "Bad CPU type in executable"), breaking recording and
screenshots. Rebuild all three as universal binaries (x86_64 + arm64) so the
desktop app runs on both architectures.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@sardorml
sardorml marked this pull request as ready for review July 2, 2026 08:45
@sardorml
sardorml self-requested a review July 2, 2026 08:45
@sardorml
sardorml marked this pull request as draft July 2, 2026 11:20
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