fix(release): isolate macOS dmg arch per matrix entry#517
Merged
Conversation
v1.10.0-beta.30 shipped both Devsy_mac_arm64.dmg and Devsy_mac_x64.dmg with the same x86_64 binary embedded. Two bugs combined: 1. desktop/electron-builder.yml listed `arch: [x64, arm64]` under each mac target, which made electron-builder build *both* arches in every matrix entry instead of honoring the CLI flag --mac --arm64 / --x64. Both macos-arm64 and macos-x64 jobs uploaded both dmgs with overwrite_files: true, so whichever job uploaded last won — and both carried that job's resources/bin/devsy regardless of the dmg's name. 2. The post-package verifier picked the first Devsy.app it found under desktop/release/ alphabetically (mac/ before mac-arm64/), so it could read the wrong bundle for the matrix entry it was meant to verify. The arm64 job verified the x64 bundle's binary (which the arm64 job had populated with arm64 bytes earlier in the same run) and got a green light. Fix: drop the per-target `arch:` lists in electron-builder.yml so the CLI flag --arm64 / --x64 is the sole arch selector, and have the verifier explicitly pick `release/mac-arm64/Devsy.app` for arm64 and `release/mac/Devsy.app` for x64 instead of using find | head.
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesmacOS per-arch build path fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for devsydev canceled.
|
skevetter
marked this pull request as ready for review
June 21, 2026 23:53
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.
Summary
v1.10.0-beta.30shipped bothDevsy_mac_arm64.dmgandDevsy_mac_x64.dmgwith the same x86_64 binary embedded — same code, different codesigns. Verified byfile+sha256sumagainst the published assets.Two distinct bugs combined to produce this:
1. electron-builder's YAML arch list is additive, not filtered by CLI
desktop/electron-builder.ymllistedarch: [x64, arm64]under each mac target. Verified against electron-builder source (targetFactory.ts):--mac --arm64puts{Arch.arm64: []}in the CLI-derivedrawmap (empty target names array).computeArchToTargetNamesMap(re: issue #1355) only fires when CLI specifies a target type (e.g.--mac dmg); empty arrays don't trigger it.platformOptions.target(the YAML) andaddValues every(target, arch)pair from the YAML'sarch:list to the result.Net:
--arm64plusarch: [x64, arm64]builds both arches. Verified by the failure log fromv1.10.0-beta.30's release run, which shows the macos-arm64 job building bothrelease/Devsy_mac_arm64.dmgandrelease/Devsy_mac_x64.dmg. Both macos-arm64 and macos-x64 matrix entries did this in parallel and uploaded withoverwrite_files: true. Whichever job uploaded last won the race — both its dmgs carried that job'sresources/bin/devsyregardless of the dmg's name.2. The post-package verifier picked the wrong .app bundle
The verifier did
find desktop/release -maxdepth 2 -type d -name 'Devsy.app' | head -n1to locate the bundle. electron-builder produces:release/mac-arm64/Devsy.app(arm64)release/mac/Devsy.app(x64)find … | head -n1returnsmac/first alphabetically, so the macos-arm64 job verified the x64 bundle. Because that bundle had been populated earlier in the same job with arm64 bytes (before electron-builder's second build pass overwrote them), the verify step got a green light against arm64 inside the bundle whose name says x64.Fix
Two changes:
desktop/electron-builder.yml: droparch:lists under each mac target. With noarch:configured, electron-builder falls back todefaultArchs = Array.from(raw.keys())— i.e. exactly what the CLI flag specified. Each matrix entry produces one dmg + zip pair for its arch..github/workflows/release.ymlpost-package verifier: replacefind | headwith explicitcaseonMATRIX_GO_ARCHmapping arm64 →release/mac-arm64/Devsy.app, amd64 →release/mac/Devsy.app. Reads the right bundle deterministically.Validation
End-to-end validation requires a real release run. Local checks:
release_artifacts verifyGo tool itself is unchanged.The next pre-release tag should produce dmgs where each arch's dmg embeds the matching binary, and the post-package verify step will fail loudly if not.
Summary by CodeRabbit