Feat/windows arm64 support#63
Conversation
…-compiler wrong-arch binaries
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughUpdated the Windows build scripts to add ARM64 build commands, and updated the README to describe x64 and ARM64 ChangesWindows ARM64 support
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@christian-wr Thanks for you PR, |
EtienneLescot
left a comment
There was a problem hiding this comment.
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)
- Diagnostic & Test Scripts:
scripts/test-windows-wgc-helper.mjsanddiagnostic-artifact.ymlcurrently hardcodewin32-x64. They should be updated to resolve the helper binary folder dynamically (e.g.const ARCH_TAG = process.arch === "arm64" ? "win32-arm64" : "win32-x64"). - Double Bundling: The wildcard filter
win32-*/*inelectron-builder.json5bundles 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.
| @@ -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", | |||
There was a problem hiding this comment.
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"
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-arm64vswin32-x64), so this PR only parameterizes the buildand 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 straightforwardonce the toolchain selection is arch-aware.
Changes
scripts/windows-helper-arch.mjs(new): a small, pure, unit-tested modulethat maps a target arch to its build parameters — the
vcvarsallargument(native
x64/arm64, crossx64_arm64/arm64_x64) and thewin32-<arch>output folder.
scripts/build-windows-wgc-helper.mjs: now builds for a target arch resolvedfrom
--arch(orOPENSCREEN_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: addsbuild:native:win:arm64andbuild:win:arm64. Existingx64 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 thatensures the MSVC ARM64 build-tools component is present.
electron/native/README.md,README.md).Building