fix: rebuild re2 for x64 on arm64 macOS CI runner (fixes #3603)#3604
Conversation
re2@1.25.0 uses install-artifact-from-github to fetch prebuilt binaries. Unlike prebuild-install, it reads process.arch (always arm64 on macos-14 runners) instead of npm_config_arch, so it downloads an arm64 re2.node even when the arch env vars are set correctly. After npm ci, delete the wrong arm64 binary and rebuild re2 from source using node-gyp with CFLAGS/CXXFLAGS/LDFLAGS="-arch x86_64". Apple's clang supports cross-compilation via -arch flags, so this produces a correct x86_64 re2.node. Also add the missing npm_config_arch=x64 flags to the desktop-ci.yml x64 build job, which only had them in the release workflow. Fixes #3603. See also #2901. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kijmf1ZHtCJHuGWXV57hGc
|
Claude finished @Yeraze's task —— View job PR Review
The fix is well-reasoned and correctly addresses the root cause. The What's GoodCorrect diagnosis and fix. Deleting the wrong-arch Verification step. The Consistent application. The fix is applied to both Missing env vars fixed. Adding Minor Issues / Observations
Re2 rebuild happens inline in "Prepare desktop resources". This means the
No retry or error handling if SecurityNo concerns. The change only affects build tooling and does not modify application code, introduce new dependencies, or expose any credentials. Test Plan AssessmentThe proposed test plan is appropriate: verifying the SummaryThis is a clean, targeted fix for a real cross-compilation issue with a tricky root cause. The only substantive suggestion is the |
Summary
Fixes #3603 — the macOS x64 DMG bundles
re2.nodeas arm64, crashing on Intel Macs.re2@1.25.0usesinstall-artifact-from-githubto fetch prebuilts. Unlikeprebuild-install, it readsprocess.arch(alwaysarm64on themacos-14runner), notnpm_config_arch— so it downloads an arm64 binary regardless of the arch env vars set by the [BUG] MeshMonitor-Desktop-4.2.0-x64.dmg bundles better_sqlite3.node as arm64 instead of x86_64 #2901 fix.npm ci, the workflow now deletes the wrong arm64re2.nodeand rebuilds it from source vianode-gypwithCFLAGS/CXXFLAGS/LDFLAGS="-arch x86_64". Apple's clang supports this cross-compilation natively.npm_config_arch=x64flags todesktop-ci.yml's x64 job (the release workflow had them; the CI workflow did not).Test plan
desktop-release.ymlx64 macOS build and verifyre2.nodeinside the DMG isx86_64(fileoutput in the build log should confirm this)ERR_DLOPEN_FAILEDcrash🤖 Generated with Claude Code
https://claude.ai/code/session_01Kijmf1ZHtCJHuGWXV57hGc
Generated by Claude Code