Conversation
…lt native modules (#176) The previous release workflow built both arm64 and x64 DMGs on a single macos-latest (arm64) runner via electron-builder's mac.target.arch list. Our install-sqlite-bindings.cjs postinstall stages per-arch better-sqlite3 prebuilds plus a legacy alias pointing at the host arch, but electron-builder's per-arch packaging pass reuses the host-arch bytes for files it does not know to re-stage. The x64 DMG ended up with an arm64 native module, so Intel Macs hit: dlopen(...better_sqlite3.node-electron.node): have 'arm64', need 'x86_64' Split the macOS build into two native-arch runners (macos-latest for arm64, macos-13 for x64) and pin electron-builder to the runner's host arch (--arm64 / --x64). Each runner does a fresh pnpm install, so the postinstall stages the correct per-arch binaries and the legacy alias matches the DMG arch. Signed-off-by: hqhq1025 <1506751656@qq.com>
Contributor
There was a problem hiding this comment.
Findings
- None. No high-confidence blocker/major/minor issues found in the added/modified lines of
.github/workflows/release.yml.
Summary
- Review mode: initial
- No issues identified in this diff.
- Residual risks/testing gaps: this workflow change cannot be fully validated from static review alone; the key risk is runtime packaging behavior on GitHub-hosted macOS runners (
macos-latestarm64 andmacos-13x64).
Testing
- Not run (automation).
- Suggested validation:
- Run the release workflow on a test tag and verify both
Build (macos-arm64)andBuild (macos-x64)succeed. - Inspect each DMG artifact and confirm
better_sqlite3.node-electron.nodearchitecture matches the DMG arch (arm64vsx86_64).
- Run the release workflow on a test tag and verify both
open-codesign Bot
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
Closes #176.
v0.1.3 on macOS Intel fails to open the snapshots DB with:
Diagnosis (scenario A)
electron-builder.ymlalready declaresmac.target.arch: [arm64, x64], and the v0.1.3 release assets include bothopen-codesign-0.1.3-arm64.dmgandopen-codesign-0.1.3-x64.dmg.macos-latest(arm64) runner.apps/desktop/scripts/install-sqlite-bindings.cjsstages per-arch prebuilds plus a legacy aliasbetter_sqlite3.node-electron.nodethat points at the host arch. The runtime resolver inapps/desktop/src/main/snapshots-db.tsprefers arch-specific files and only falls back to the legacy alias when they are missing.Fix
Split the macOS build into native-arch runners and pin electron-builder to each runner's host arch. Each runner does a fresh
pnpm install, so our postinstall stages the correct per-arch binaries and the legacy alias matches the DMG arch.macos-latest(Apple Silicon) builds--arm64→open-codesign-*-arm64.dmgmacos-13(Intel) builds--x64→open-codesign-*-x64.dmgScope is limited to
.github/workflows/release.yml. Runtime resolution code andelectron-builder.ymlare unchanged.Principles check
Test plan
Cannot fully verify locally (needs the full release workflow + published artifacts). Required CI validation:
v0.1.4-rc.1) or dispatch theReleaseworkflow against a test tag.Build (macos-arm64)onmacos-latestandBuild (macos-x64)onmacos-13, each finishing green.hdiutil attach open-codesign-*-x64.dmgand runlipo -archs 'Open CoDesign.app/Contents/Resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node-electron.node'→ expectx86_64.arm64.Local CI signal:
pnpm lintandpnpm typecheckboth green on this branch.