fix(build): Add win-arm64 support and fix missing executable in NSIS installer - #435
Conversation
… in arm64 payload
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds Windows ARM64 runtime assets, platform selection, staging, packaging commands, distribution pipelines, native dependency rebuilding, release publication, updater metadata, and binary validation. It also adds architecture-specific release workflow coverage. ChangesWindows ARM64 release support
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant PackageScripts
participant RuntimeStaging
participant DistributionScript
participant ElectronRebuild
participant ElectronBuilder
participant BundleValidation
participant UpdaterFeed
ReleaseWorkflow->>PackageScripts: run architecture-specific Windows command
PackageScripts->>RuntimeStaging: stage matching runtime assets
PackageScripts->>DistributionScript: invoke Electron distribution
DistributionScript->>ElectronRebuild: rebuild better-sqlite3 for Windows ARM64
DistributionScript->>ElectronBuilder: package target architecture
ElectronBuilder->>BundleValidation: validate native binary architectures
BundleValidation-->>ElectronBuilder: accept ARM64 binaries or reject x64 binaries
ReleaseWorkflow->>UpdaterFeed: publish x64 and ARM64 installer references
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/electron-builder/afterPack.cjs`:
- Around line 293-298: Update isKnownAllowedNativeMismatch to accept targetArch
and require targetArch === 'arm64' in the Windows PE x64 allowlist branch, while
preserving the existing platform, format, and architecture checks. Pass
targetArch from its callers, and add a regression test confirming an ia32 target
does not allow these mismatches.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c7186d2b-4edf-4440-8a5b-f156d4c97dbd
📒 Files selected for processing (2)
package.jsonscripts/electron-builder/afterPack.cjs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8153d12731
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d71da7c248
ℹ️ 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".
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6eb8cb387f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e8d8a62fb
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d045ff4d0
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/scripts/promoteExistingDraft.test.ts (1)
69-73: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAssert the ARM64 checksum in the feed test.
buildUpdaterFeedsnow emits an ARM64sha512entry. The test checks the ARM64 filename but not its checksum. A wrong ARM64 checksum would pass this test and fail updater validation.Add
windowsArm64Shafrom the ARM64 fixture and assert it inlatest.yml.Proposed test change
const windowsBytes = Buffer.from(`fixture:${layout.feedSources.windowsX64}`); const windowsSha = createHash('sha512').update(windowsBytes).digest('base64'); + const windowsArm64Bytes = Buffer.from(`fixture:${layout.feedSources.windowsArm64}`); + const windowsArm64Sha = createHash('sha512') + .update(windowsArm64Bytes) + .digest('base64'); expect(feeds['latest.yml']).toContain('version: 2.9.0'); expect(feeds['latest.yml']).toContain(`sha512: ${windowsSha}`); + expect(feeds['latest.yml']).toContain(`sha512: ${windowsArm64Sha}`); expect(feeds['latest.yml']).toContain(layout.feedSources.windowsArm64);As per coding guidelines, changed test files must provide focused coverage for Git and release workflows.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/scripts/promoteExistingDraft.test.ts` around lines 69 - 73, Add an ARM64 checksum fixture calculation alongside windowsSha in the feed test, using the windowsArm64 fixture from layout.feedSources, then assert the resulting sha512 value appears in feeds['latest.yml'] next to the existing ARM64 filename assertion. Preserve the current Windows x64 checks and version assertion.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/electron-builder/dist-invocations.cjs`:
- Around line 86-95: Update runWithNativeDependencyRestore so a restore failure
does not replace an earlier target rebuild or packageTarget failure: capture the
original error from the try block, perform the restore, and rethrow the original
error when both operations fail while still propagating restore failures when no
earlier error exists. Extend the existing electronBuilderDistScript test
coverage for the compound-failure case.
---
Nitpick comments:
In `@test/scripts/promoteExistingDraft.test.ts`:
- Around line 69-73: Add an ARM64 checksum fixture calculation alongside
windowsSha in the feed test, using the windowsArm64 fixture from
layout.feedSources, then assert the resulting sha512 value appears in
feeds['latest.yml'] next to the existing ARM64 filename assertion. Preserve the
current Windows x64 checks and version assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 05caa490-6f80-45f3-9c08-088f728bd4fd
📒 Files selected for processing (13)
.github/workflows/release.ymldocs/RELEASE.mdlanding/data/downloads.tsscripts/ci/promote-existing-draft.d.mtsscripts/ci/promote-existing-draft.mjsscripts/ci/verify-published-updater-release.shscripts/electron-builder/dist-invocations.cjsscripts/electron-builder/dist.mjssrc/main/services/infrastructure/updaterReleaseMetadata.tstest/main/build/electronBuilderDistScript.test.tstest/main/services/infrastructure/updaterReleaseMetadata.test.tstest/scripts/promoteExistingDraft.test.tstest/scripts/releaseWorkflowWindowsArm64.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e0c3325f2
ℹ️ 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".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd68628e01
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66f9cd4e06
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b3fed3db3
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97912451fb
ℹ️ 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".
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5744d3ce3
ℹ️ 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".
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f9cc3d722
ℹ️ 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".
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30a1f6f491
ℹ️ 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".
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79af3f50ea
ℹ️ 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".
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
ReviewRouter ignored this command because fork pull requests do not receive secret-backed review automation by default. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Hi @alwattar, and welcome! Thank you so much for this contribution. Windows ARM64 support was an important gap, and this was a really valuable catch. I appreciate you taking the time to put the fix together and help us improve support across the app and runtimes. Merged, thanks again! |
|
Thank you! It's my pleasure to contribute to such a great project. Glad to see Windows ARM64 is finally supported. Happy to help anytime |
What does this PR do?
Why is this necessary?
Windows x64 emulation can run standalone x64 executables, but an ARM64 Electron process cannot load an x64 N-API addon. Native ARM64 runtime payloads are required for the terminal workspace and packaged app to work correctly.
Published dependencies
Verification
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests