Skip to content

🤖 fix: bundle macOS sharp runtimes for both architectures#3434

Open
coadler wants to merge 1 commit into
mainfrom
fix/macos-sharp-runtimes
Open

🤖 fix: bundle macOS sharp runtimes for both architectures#3434
coadler wants to merge 1 commit into
mainfrom
fix/macos-sharp-runtimes

Conversation

@coadler
Copy link
Copy Markdown
Collaborator

@coadler coadler commented Jun 1, 2026

Summary

Fixes the Intel macOS startup failure from #3338 by ensuring macOS release packaging installs both Darwin sharp runtime variants before Electron Builder copies node_modules, then verifies those architecture-specific assets in CI.

Background

The published x64 macOS artifacts could contain only @img/sharp-darwin-arm64 / @img/sharp-libvips-darwin-arm64, causing sharp to fail at startup on Intel Macs when it tried to load the missing darwin-x64 runtime.

Implementation

  • Adds a Makefile packaging prerequisite that runs documented Bun installs for both --cpu=x64 and --cpu=arm64 with --os=darwin before every macOS Electron Builder target.
  • Strengthens checkMacAttachFileRuntime.ts to inspect packaged app architectures with lipo and assert the exact sharp and libvips packages exist for each architecture.
  • Runs the packaged attach_file runtime smoke test in the PR macOS build, not just release builds.

Validation

  • git diff --check
  • make ensure-mac-sharp-runtime-deps
  • nix shell nixpkgs#shfmt nixpkgs#shellcheck nixpkgs#hadolint -c make static-check
  • make lint-actionlint

Risks

Low-to-medium release-pipeline risk: this changes macOS packaging only, but it intentionally reruns bun install before Electron Builder so the packaged node_modules tree includes both macOS native sharp runtimes. The smoke test now catches missing architecture-specific runtime assets before artifacts are uploaded.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $0.00

@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented Jun 1, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ad47eb605

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Makefile Outdated
Install Darwin sharp optional dependencies for both x64 and arm64 before macOS packaging, and strengthen the packaged attach_file smoke test to assert the architecture-specific sharp/libvips assets are present.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=0.00 -->
@coadler coadler force-pushed the fix/macos-sharp-runtimes branch from 7ad47eb to bb0d489 Compare June 1, 2026 04:52
@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented Jun 1, 2026

@codex review

Please take another look. I replaced the wildcard CPU selector with two documented Bun installs (--cpu=x64 and --cpu=arm64) and re-ran local validation.

@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented Jun 1, 2026

@codex review

Re-requesting review after the previous feedback was resolved and CI is now green.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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