getPlatform() always resolves macOS to osx-x64, breaking Apple Silicon without Rosetta — and Rosetta 2 is being phased out starting macOS 27
getPlatform() in dist/core/utils/platform.js maps darwin unconditionally to "osx-x64", regardless of os.arch():
export function getPlatform() {
switch (os.platform()) {
case "win32": return "win-x64";
case "darwin": return "osx-x64";
...
}
}
This means swa deploy always downloads the x64 StaticSitesClient binary on every Mac, including Apple Silicon (arm64), with no native arm64 target in the release manifest at all. On an Apple Silicon machine without Rosetta 2 installed, this fails with:
✖ Deployment Failure Reason: spawn Unknown system error -86
(-86 is EBADARCH — the kernel refusing to run an x86_64 binary with no translation layer available.)
This is more than a papercut going forward. Apple's own WWDC 2026 statement on Rosetta 2: "we plan to make it available for the next two major macOS releases — through macOS 27 — as a general-purpose tool for Intel apps." macOS 27 is the current release. Starting with macOS 28 (fall 2027), Rosetta 2 narrows to a limited mode for older games only — general-purpose CLI tools like this one won't be able to fall back to it at all. Once that ships, swa deploy will be completely broken on every Apple Silicon Mac, with no workaround, not just failing for users who haven't separately installed Rosetta.
Ask: add a real osx-arm64 platform target (mirroring the existing win-x64/linux-x64 distinction) so Apple Silicon Macs get a native binary. Related: #306 (StaticSitesClient source was never published, so the community can't build this themselves) and #631 (request to ship binaries with the CLI rather than downloading on demand) — a native arm64 build needs solving regardless of how either of those land.
Sources:
I can confirm this on macOS 27.2.1 (build 26B131), Apple Silicon, without Rosetta 2 installed.
The release manifest has no arm64 build. https://aka.ms/swalocaldeploy lists the same three platforms for all three entries:
| version | buildId | published | files |
|---|---|---|---|
| latest | a58ffd5ddfce… |
2026-10-29 | linux-x64, win-x64, osx-x64 |
| stable | a58ffd5ddfce… |
2026-10-29 | linux-x64, win-x64, osx-x64 |
| backup | 134664351bac… |
2026-09-28 | linux-x64, win-x64, osx-x64 |
The binary the CLI downloaded is Intel only, and it cannot start:
$ file ~/.swa/deploy/a58ffd5ddfced557500b295844f2490acc313951/StaticSitesClient
StaticSitesClient: Mach-O 64-bit executable x86_64
$ ~/.swa/deploy/a58ffd5ddfced557500b295844f2490acc313951/StaticSitesClient --version
bad CPU type in executable
So changing getPlatform() would not be enough on its own: there is nothing for it to choose yet. azd deploy for a static web app uses the same client, so it is affected too.
Workaround without Rosetta: run the Linux client in a container. This worked for us on Apple Silicon with Docker, for a site that is already built into dist:
export TOKEN=... # the deployment token of the static web app
docker run --rm --platform linux/amd64 -e TOKEN -e DEPLOYMENT_PROVIDER=SwaCli -e REPOSITORY_BASE=/ \
-v "$PWD/dist:/app/dist:ro" -w /admin \
mcr.microsoft.com/appsvc/staticappsclient:stable \
sh -c '/bin/staticsites/StaticSitesClient upload --workdir /app --app /app/dist --skipAppBuild true --apiToken "$TOKEN"'
Could you say whether a native osx-arm64 build (and linux-arm64, see #987) is planned? The oldest report of this that I found is #742, from August 2023.