Skip to content

Feat/windows arm64 support#63

Open
christian-wr wants to merge 12 commits into
getopenscreen:mainfrom
christian-wr:feat/windows-arm64-support
Open

Feat/windows arm64 support#63
christian-wr wants to merge 12 commits into
getopenscreen:mainfrom
christian-wr:feat/windows-arm64-support

Conversation

@christian-wr

@christian-wr christian-wr commented Jul 2, 2026

Copy link
Copy Markdown

Native Windows ARM64 support

Summary

Adds a native Windows on ARM (arm64) build target alongside the existing x64
build. The app's runtime already resolved an architecture-specific native-helper
folder (win32-arm64 vs win32-x64), so this PR only parameterizes the build
and packaging
side, which was previously hardcoded to x64. macOS arm64 and x64
are unchanged.

Motivation

Windows-on-ARM devices (Snapdragon X, etc.) currently have no native installer and
must run OpenScreen under x64 emulation. The C++ WGC capture helper links only
standard Windows libraries (d3d11, dxgi, Media Foundation, runtimeobject,
windowsapp, …), all available for arm64, so a native build is straightforward
once the toolchain selection is arch-aware.

Changes

  • scripts/windows-helper-arch.mjs (new): a small, pure, unit-tested module
    that maps a target arch to its build parameters — the vcvarsall argument
    (native x64/arm64, cross x64_arm64/arm64_x64) and the win32-<arch>
    output folder.
  • scripts/build-windows-wgc-helper.mjs: now builds for a target arch resolved
    from --arch (or OPENSCREEN_WIN_HELPER_ARCH), defaulting to the host arch.
    Supports both native (arm64 host) and cross (x64 CI host → arm64) builds.
    The CMake build directory is wiped when the target arch changes, so building both
    arches in one working tree can't produce stale wrong-arch binaries.
  • package.json: adds build:native:win:arm64 and build:win:arm64. Existing
    x64 scripts are unchanged.
  • electron-builder.json5: the Windows installer name now includes the arch
    (Openscreen.Setup.<version>-<arch>.exe) so x64 and arm64 installers don't collide.
  • .github/workflows/build.yml: the Windows job now builds an [x64, arm64]
    matrix on windows-latest (arm64 is cross-compiled). Includes a guard that
    ensures the MSVC ARM64 build-tools component is present.
  • Docs updated (electron/native/README.md, README.md).

Building

# host-arch default (arm64 on an arm64 host, x64 on x64)
npm run build:native:win

# explicit arm64 (native or cross-compiled)
npm run build:win:arm64

<!-- discord-thread-id:1522208040713978019 -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added Windows ARM64 build support alongside existing x64 release builds.
  * Windows installer generation now supports ARM64 `.exe` builds in addition to x64.

* **Documentation**
  * Updated Windows installation instructions to clarify that `.exe` installer builds are available for both x64 and ARM64, including the expected filename patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a876f864-9598-4972-81f1-1c8f1cba99a9

📥 Commits

Reviewing files that changed from the base of the PR and between b315d0d and b29f832.

📒 Files selected for processing (1)
  • package.json
✅ Files skipped from review due to trivial changes (1)
  • package.json

📝 Walkthrough

Walkthrough

Updated the Windows build scripts to add ARM64 build commands, and updated the README to describe x64 and ARM64 .exe installer filenames.

Changes

Windows ARM64 support

Layer / File(s) Summary
ARM64 build scripts
package.json
Adds build:native:win:arm64 and build:win:arm64 scripts for the Windows ARM64 build pipeline.
Windows installer notes
README.md
Updates the Windows download instructions to include x64 and ARM64 .exe builds and their filename patterns.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and clearly states the main change: Windows ARM64 support.
Description check ✅ Passed The description is substantive and covers summary, motivation, changes, and build steps, but it misses template sections like Related issue, Type of change, and Testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot

EtienneLescot commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

@christian-wr Thanks for you PR,
What e2e tests did you make?

@EtienneLescot EtienneLescot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the contribution! This PR is clean, well-tested, and correctly establishes architecture-aware Windows builds. Wiping the CMake build directory on target architecture change is an excellent design choice.

I have requested a few minor adjustments to avoid build discrepancies on ARM64 developer machines and keep diagnostic test scripts aligned. Please see the inline comment and additional notes below.

Additional Notes (Non-blocking)

  1. Diagnostic & Test Scripts: scripts/test-windows-wgc-helper.mjs and diagnostic-artifact.yml currently hardcode win32-x64. They should be updated to resolve the helper binary folder dynamically (e.g. const ARCH_TAG = process.arch === "arm64" ? "win32-arm64" : "win32-x64").
  2. Double Bundling: The wildcard filter win32-*/* in electron-builder.json5 bundles both the x64 and ARM64 C++ binaries in every installer. This is perfectly acceptable, but adds ~1-2 MB of overhead containing the unused architecture's helper.

Comment thread package.json
@@ -30,6 +30,8 @@
"build:mac": "npm run build:native:mac && tsc && vite build && electron-builder --mac",
"build:native:win": "node scripts/build-windows-wgc-helper.mjs",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To prevent host-architecture compilation conflicts on Windows ARM64 developer machines (where npm run build:win might compile the ARM64 helper instead of the x64 one required by the x64 packaged app), we should explicitly pass the --arch x64 flag here:

"build:native:win": "node scripts/build-windows-wgc-helper.mjs --arch x64"

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.

2 participants