Repository navigation
Desktop: build and ship a native Windows ARM64 installer - #11122
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| - platform: windows-latest | ||
| args: '--target aarch64-pc-windows-msvc' | ||
| label: Windows (ARM64) | ||
| artifact: windows-arm64 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
…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>
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.ps1reads 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 samewindows-latestrunner, the way the macOS leg cross compilesaarch64-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.targetsexception 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, andpublish-releasedownloads every leg's artifact into one directory withmerge-multiple: true. Staged under the old suffix map they would both becomeUnsloth-Desktop-Windows.exeand 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 stagesUnsloth-Desktop-Windows-ARM64.exe.Its own updater entry. Tauri looks an update up by
{os}-{arch}. Withoutwindows-aarch64an ARM64 install either never sees an update or takes thex86_64one and replaces a native install with an emulated build. Both bundles end in.exe.sigand the generator'sexactly_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-aarch64family, and the post promotion check expects the ARM64 installer among the stable downloads.What was deliberately left alone
publish-desktop-updater.ymlis 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_the_build_matrix_covers_windows_on_armtest_the_two_windows_legs_never_stage_the_same_asset_nametest_the_updater_manifest_points_windows_arm64_at_its_own_bundlewindows-aarch64resolving to the x64 bundleThe 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-nsisaliases 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.pyandtests/python/test_virustotal_scan.py: 160 passed, 6 skipped. actionlint reports the same single pre-existing finding as main (thequeueconcurrency 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: truebefore 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.