Skip to content

build: Windows on ARM64, stage 1 (CI, scripts, ARM64 rhwp and Unhwp) - #822

Merged
KnifeLemon merged 10 commits into
mainfrom
feat/win-arm64
Oct 30, 2026
Merged

KnifeLemon merged 10 commits into
mainfrom
feat/win-arm64

Conversation

@KnifeLemon

@KnifeLemon KnifeLemon commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

What does this change?

Stage 1 of native Windows on ARM64: Filee builds and tests natively on a windows-11-arm runner, the build scripts can make a win-arm64 Setup and portable zip, and Unhwp and rhwp get ARM64 builds (Unhwp on Linux ARM64 too, where it was off until now). Release workflow, signing and store manifests are left for stage 2.

Refs #236

Unhwp on ARM64

  • build/build-native.py (renamed from build-linux-native.py) gains an unhwp subcommand: cargo build --release --locked -p unhwp --lib --features ffi at 405b17e, the commit the Unhwp 0.13.0 nuspec names. Upstream's bindings workflow uses the same command. It loads the result and checks that unhwp_version() returns 0.13.0. check now also fails when Directory.Packages.props moves to another Unhwp version.
  • Linux ARM64: the linux-native job builds libunhwp.so on Ubuntu 22.04 ARM, next to rhwp. The glibc 2.35 check covers it. The arm64 tests are built with it (-p:UnhwpNativeLibrary=...), and so is the package (build-portable.ps1 -UnhwpOverride). smoke-portable.ps1 loads libunhwp.so from every Linux package.
  • Filee.Engines.csproj: when UnhwpNativeLibrary is set, the library is copied next to the app on build and publish. That is where Unhwp's own resolver looks for it. When the property is unset, which covers every x64 and macOS build, nothing changes.
  • UnhwpConverter.GetStatus() now asks the library for its version through Unhwp's own P/Invoke instead of checking a hard-coded architecture list. It caches the answer. If the library can't be loaded, the engine reports engine.reason.unsupported_platform. One exception on Windows: if unhwp.dll is there but won't load (the C++ runtime is missing), the engine stays listed and the conversion still reports error.runtime_missing, the same as before.

rhwp and Unhwp for Windows ARM64: built once, then pinned

.github/workflows/windows-arm64-native.yml builds rhwp.exe and unhwp.dll on windows-11-arm from the same pinned commits. It uses +crt-static, so neither file imports a Visual C++ runtime DLL (the script checks the PE import table and the machine type). It uploads rhwp-v0.8.7-windows-aarch64.zip, unhwp-0.13.0-win-arm64.dll and SHA256SUMS.txt. It runs from the Actions tab, and also on pull requests that change the build script or the workflow, so this PR already has a run.

I followed the Magick.Native pattern for Windows instead of building in every CI run as linux-native does. Reasons:

  • The release and the PC signing step can use fixed, hashed files.
  • The ARM64 CI job doesn't need a Rust toolchain.
  • One build can't come out different from the next.

The pins live in $arm64Pins in build/fetch-engines.ps1. The URLs on dl.filee.sh are filled in; sha256 stays empty until the files are hosted. While a pin is empty, a win-arm64 build stops with a message that names the workflow and the URL. Linux ARM64 Unhwp is built in the existing native job, like rhwp, because that job already exists and caches by script hash.

Packaging for win-arm64

  • build/fetch-engines.ps1 -Runtime win-arm64 (default win-x64):
    • rhwp and unhwp\unhwp.dll come from the ARM64 pins.
    • 7-Zip is the official 7z2605-arm64.exe, the same version as x64, pinned by SHA-256. It is a 7z SFX that Windows' tar.exe can't unpack correctly (it can't undo the ARM64 branch filter, so the CRC check fails), so the x64 7-Zip from the MSI unpacks it, under emulation on ARM64. Only 7z.exe, 7z.dll, License.txt and readme.txt are kept, as on x64.
    • No C++ runtime DLLs are copied, and -RuntimeTo is refused for win-arm64.
    • The other engines are the x64 downloads.
    • -MissingPins lists the win-arm64 pins that aren't filled in yet (CI uses it).
  • build/build-installer.ps1 -Runtime win-arm64:
    • publishes the app, CLI and Setup for win-arm64, with -p:UnhwpNativeLibrary;
    • builds the Explorer menu DLL for ARM64;
    • writes Filee-<v>-win-arm64-Setup.exe, -win-arm64-Portable.zip and -win-arm64-SHA256SUMS.txt. The x64 names are unchanged.
  • build/build-explorer-menu.ps1 -Architecture x64|arm64: the pinned x64 Zig cross-compiles aarch64-windows-gnu, and the package says arm64 (ExplorerMenuPackage.CreateManifest(architecture)). ExplorerMenuRegistration.IsSupportedOs now requires Windows 11 on x64 or ARM64 with Filee running natively, so an x64 Filee on ARM64 still gets no menu, as before.

CI

New build (win-arm64) job on windows-11-arm, using the same changes filter as build. It does restore, build, Explorer menu (arm64), the UI tests on their own, the other tests, and build-installer.ps1 -CheckOnly -Runtime win-arm64, which runs the ARM64 Setup in its sandbox. Until both pins are filled in, it warns and the rhwp and Unhwp tests skip. After that, it also tests with the pinned files and uploads windows-arm64-package.

For the maintainer

  1. Take the windows-arm64-native artifact from this PR's "Windows ARM64 native" run (or run the workflow after merging).
  2. Upload rhwp-v0.8.7-windows-aarch64.zip to https://dl.filee.sh/engines/rhwp/0.8.7/ and unhwp-0.13.0-win-arm64.dll to https://dl.filee.sh/engines/unhwp/0.13.0/.
  3. Copy both hashes from SHA256SUMS.txt into $arm64Pins in build/fetch-engines.ps1. CI's win-arm64 job then also tests rhwp and Unhwp and builds the package.

Left for stage 2

  • The release workflow, signing, and store and WinGet manifests.
  • The update check: UpdateService looks for -win-Setup.exe, so an ARM64 install would be offered the x64 Setup.
  • Engine downloads: EngineDownloads reads components only for win-x64, so on win-arm64 the app and Setup offer no downloads yet. It needs a decision on whether to offer the x64 engines under emulation (Windows 11 only).

Type of change

  • Build, CI or dependencies

How was it tested?

  • dotnet format --verify-no-changes
  • dotnet test: locally on x64, the Unhwp, HWPX writer, document engine and Explorer menu tests, plus build-installer.ps1 -CheckOnly. CI runs the rest, including on windows-11-arm.
  • Locally: built the ARM64 Explorer menu DLL and package (machine 0xAA64; imports only kernel32, user32, ole32, shell32 and shlwapi) and ran the package test against it; ran fetch-engines.ps1 -Runtime win-arm64 -Only 7zip (ARM64 7z.exe/7z.dll); checked that -Only rhwp,unhwp and build-installer.ps1 -Runtime win-arm64 stop with the "not pinned yet" message; checked that -p:UnhwpNativeLibrary lands in the publish folder.

Checklist

  • New third-party code or binaries are listed in THIRD-PARTY-NOTICES.md
  • The PR does one thing

🤖 Generated with Claude Code

- build/build-native.py (was build-linux-native.py) also builds Unhwp's native
  library from the commit its NuGet package names, and builds rhwp and Unhwp on
  Windows with the C runtime linked statically.
- linux-native builds libunhwp.so for linux-arm64; the arm64 tests and package
  use it (-p:UnhwpNativeLibrary, build-portable.ps1 -UnhwpOverride).
- New workflow windows-arm64-native.yml builds rhwp.exe and unhwp.dll for
  win-arm64 to host on dl.filee.sh; fetch-engines.ps1 pins them (empty until
  hosted) plus the official 7-Zip ARM64 build, and fails clearly while unpinned.
- UnhwpConverter reports Unhwp as available where its library loads.
- build-explorer-menu.ps1 -Architecture arm64; the Explorer menu is offered
  when Filee runs natively on x64 or ARM64 Windows 11.
- build-installer.ps1 and fetch-engines.ps1 take -Runtime (default win-x64).
- CI: build (win-arm64) job on windows-11-arm.

Refs #236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the build Build and release label Oct 30, 2026
KnifeLemon and others added 9 commits October 30, 2026 18:48
Refs #236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows 11 on ARM runs them under emulation; Windows 10 on ARM gets none.
The bundled rhwp and 7-Zip stay ARM64 builds of the same versions.

Refs #236

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the win-arm64 runner Pandoc is fetched but rhwp isn't (its ARM64 build
isn't pinned yet), so Markup → PDF takes Pandoc's route and the asserts
for hwpx-writer → rhwp failed. Skip them unless rhwp is available, as
DocumentEngineTests does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Built by "Windows ARM64 native" (run 41040250454) from the pinned
sources, hosted on dl.filee.sh; both downloads checked against the run's
SHA256SUMS.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KnifeLemon

Copy link
Copy Markdown
Owner Author

The pins are filled in (5660b9a). rhwp 0.8.7 and Unhwp 0.13.0 for Windows ARM64 are hosted on dl.filee.sh, and both downloads match the native run's SHA256SUMS.txt.

CI is green on every job:

  • build (win-arm64) now runs the rhwp and Unhwp tests natively;
  • it builds the windows-arm64-package artifact (run 41045476235).

Merging stage 1. Release, signing and store work stays for stage 2 (#236).

@KnifeLemon
KnifeLemon merged commit 7fc129f into main Oct 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant