Skip to content

Desktop: build and ship a native Windows ARM64 installer - #11122

Merged
danielhanchen merged 5 commits into
mainfrom
desktop-windows-arm64
Sep 17, 2026
Merged

danielhanchen merged 5 commits into
mainfrom
desktop-windows-arm64

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Windows on ARM users download the x64 installer today and run the desktop app under emulation. Everything the app then installs is already native: install.ps1 reads the host architecture from the machine scope registry rather than from its own process, so it replaces an x64 Python with a native ARM64 one, and the llama.cpp bundle is chosen in Python inside that ARM64 venv. The shell around it is the last emulated piece.

This adds the leg that builds it.

What changed

A fourth matrix leg. aarch64-pc-windows-msvc, cross compiled on the same windows-latest runner, the way the macOS leg cross compiles aarch64-apple-darwin. There is no ARM64 Windows runner to build on. The Rust toolchain step installs the target, which it previously did only for macOS.

No bundle.targets exception was needed: NSIS is the only Windows target configured and it supports ARM64. WiX does not, and we do not build MSI.

Distinct asset names. Both Windows legs emit a -setup.exe, and publish-release downloads every leg's artifact into one directory with merge-multiple: true. Staged under the old suffix map they would both become Unsloth-Desktop-Windows.exe and one would silently overwrite the other, so the release would ship one architecture twice under a name that claims otherwise. The x64 leg keeps its historical name, which is the published download link; the new leg stages Unsloth-Desktop-Windows-ARM64.exe.

Its own updater entry. Tauri looks an update up by {os}-{arch}. Without windows-aarch64 an ARM64 install either never sees an update or takes the x86_64 one and replaces a native install with an emulated build. Both bundles end in .exe.sig and the generator's exactly_one() refuses an ambiguous match, so the two entries are now selected by full name.

The gates were extended to match, rather than left to pass by accident: the publish waiter names the new leg, the asset set validator expects the two new files, the manifest check requires the windows-aarch64 family, and the post promotion check expects the ARM64 installer among the stable downloads.

What was deliberately left alone

publish-desktop-updater.yml is unchanged. Its four "complete download set" checks judge historical releases when advancing or repairing the channel, and no release published before this change has an ARM64 asset. Adding the suffix there would make every existing release read as incomplete and block promotion. Its platform family check is left alone for the same reason. Neither is a gap: that workflow validates unknown platform keys it does not recognise (URL prefix, signature, and that the bundle exists as a release asset), so the new entry is checked, just not required on releases that predate it.

Tests

Four new assertions, each written against a way this can go wrong, and each verified to fail without the fix:

Test Kills
test_the_build_matrix_covers_windows_on_arm leg removed, or Rust target not installed
test_the_two_windows_legs_never_stage_the_same_asset_name staging map not arch aware, so the two legs collide
test_the_updater_manifest_points_windows_arm64_at_its_own_bundle windows-aarch64 resolving to the x64 bundle
existing integrity and permissions tests, updated fixture and leg count drift

The staging test executes the real "Stage release assets" step for both legs against Tauri shaped filenames (Unsloth Studio_0.1.50_arm64-setup.exe) and asserts the results do not intersect. The manifest test runs the publish sequence and asserts the ARM64 URL, the x64 URL, and that the -nsis aliases resolve to the same bundle as their bare keys.

tests/security/test_release_desktop_integrity.py, test_release_desktop_permissions.py, test_release_desktop_signing_simulation.py, test_desktop_updater_pointer.py, tests/studio/test_tauri_branding_contract.py and tests/python/test_virustotal_scan.py: 160 passed, 6 skipped. actionlint reports the same single pre-existing finding as main (the queue concurrency key it does not know about) and nothing new.

What this does not prove

No ARM64 bundle has been built yet. I have not dispatched this workflow, so the parts that only a real run exercises are unverified: that the cross compile links, that NSIS produces an ARM64 installer, that Trusted Signing signs it, and that Defender scans it cleanly. The signing and scanning steps are keyed on matrix.platform == 'windows-latest' and so now run for both Windows legs, which is intended but also untested.

Worth a dispatch with draft: true before a real release depends on it. The publish gate now waits on this leg, so if the cross compile fails, the release fails rather than shipping a partial set, which is the safe direction but does mean a broken leg blocks a release.

Windows on ARM users currently download the x64 installer and run the app
under emulation. The Python stack and the llama.cpp bundles it installs are
already native ARM64, so this is the last emulated piece.

Add a fourth matrix leg that cross compiles aarch64-pc-windows-msvc on the
same x64 runner, stage it as Unsloth-Desktop-Windows-ARM64.exe so it cannot
collide with the x64 installer, and give it its own windows-aarch64 entry in
latest.json so an ARM64 install is never offered the x64 build.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-17T12:29:14.605201Z 47a4778 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 284c0c48ac

ℹ️ 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".

Comment on lines +527 to +530
- platform: windows-latest
args: '--target aarch64-pc-windows-msvc'
label: Windows (ARM64)
artifact: windows-arm64

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Upload signed scripts from only one Windows leg

Adding this second windows-latest leg makes both matrix jobs execute “Upload signed scripts,” where each uses the unchanged artifact name release-scripts-signed. actions/upload-artifact v4 and later refuse a duplicate artifact name within a workflow run (also documented in .github/workflows/windows-vt-preflight.yml), so whichever Windows leg uploads second fails before building its installer; the publish waiter then rejects the release. Restrict this architecture-independent upload to one Windows leg, or give the uploads distinct names and adjust the downstream download.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct catch, and it would have taken the release down. Both legs are platform: windows-latest, so gating on the platform meant both ran the step with the fixed name release-scripts-signed, and upload-artifact v4 and later answer 409 from CreateArtifact on a duplicate name within a run (actions/upload-artifact#478, #493); this repo already records the same rule in windows-vt-preflight.yml.

It resolved a bit differently in the end. Main removed standalone signed-script publishing altogether in #11123, so after merging main the step and its artifact are gone and there is nothing left to collide. I kept the guard rather than the one-line gate, because the underlying hazard is new and permanent: two legs now share windows-latest, so matrix.platform is no longer a unique key and any future fixed-name upload gated on it would hit exactly this. test_no_matrix_leg_shares_a_fixed_artifact_name_with_another asserts that every upload-artifact in the build job either carries matrix.artifact in its name or is pinned to exactly one leg; it fails if the old gate is put back.

The other three uploads in that job already carry matrix.artifact.

Both Windows legs run on windows-latest, so gating this step on the platform
made both of them upload the fixed artifact name release-scripts-signed.
upload-artifact v4 and later refuse a duplicate name within a run and answer
409 from CreateArtifact, so whichever leg finished second would fail before
building its installer and the publish waiter would then reject the release.

The scripts are architecture independent, so one upload is right; it moves to
matrix.artifact, the only matrix key that is unique per leg now that two legs
share a platform. The other three uploads in the job already carry
matrix.artifact in their names.

test_no_matrix_leg_shares_a_fixed_artifact_name_with_another pins the class
rather than this one step: any upload whose name is a literal must be gated on
exactly one leg.
# Conflicts:
#	.github/workflows/release-desktop.yml
#	tests/studio/playwright_queue_localization.py
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 47a4778f57

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 97730eb into main Sep 17, 2026
3 of 37 checks passed
@danielhanchen
danielhanchen deleted the desktop-windows-arm64 branch September 17, 2026 13:01
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…1122)

* Desktop: build and ship a native Windows ARM64 installer

Windows on ARM users currently download the x64 installer and run the app
under emulation. The Python stack and the llama.cpp bundles it installs are
already native ARM64, so this is the last emulated piece.

Add a fourth matrix leg that cross compiles aarch64-pc-windows-msvc on the
same x64 runner, stage it as Unsloth-Desktop-Windows-ARM64.exe so it cannot
collide with the x64 installer, and give it its own windows-aarch64 entry in
latest.json so an ARM64 install is never offered the x64 build.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Upload the signed scripts from the x64 leg only

Both Windows legs run on windows-latest, so gating this step on the platform
made both of them upload the fixed artifact name release-scripts-signed.
upload-artifact v4 and later refuse a duplicate name within a run and answer
409 from CreateArtifact, so whichever leg finished second would fail before
building its installer and the publish waiter would then reject the release.

The scripts are architecture independent, so one upload is right; it moves to
matrix.artifact, the only matrix key that is unique per leg now that two legs
share a platform. The other three uploads in the job already carry
matrix.artifact in their names.

test_no_matrix_leg_shares_a_fixed_artifact_name_with_another pins the class
rather than this one step: any upload whose name is a literal must be gated on
exactly one leg.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant