{"record":{"id":"1bc57c47bba6b355","repo":"SubtitleEdit/subtitleedit","slug":"unsupported-macos-architecture-1bc57c","errorCode":null,"errorMessage":"Unsupported macOS architecture.","messagePattern":"Unsupported macOS architecture\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"error","filePath":"src/ui/Logic/Download/WhisperDownloadService.cs","lineNumber":166,"sourceCode":"        {\n            if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)\n            {\n                throw new PlatformNotSupportedException(\"whisper.cpp Vulkan build is not available for Linux ARM64.\");\n            }\n\n            return LinuxUrl;\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            switch (RuntimeInformation.ProcessArchitecture)\n            {\n                case Architecture.Arm64:\n                    return MacArmUrl; // e.g., for M1, M2, M3, M4 chips\n                case Architecture.X64:\n                    return MacX64Url;\n                default:\n                    throw new PlatformNotSupportedException(\"Unsupported macOS architecture.\");\n            }\n        }\n\n        throw new PlatformNotSupportedException();\n    }\n\n    private static string GetUrlCuBlas()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            return WindowsUrlCuBlass;\n        }\n\n        if (OperatingSystem.IsLinux())\n        {\n            if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)\n            {\n                throw new PlatformNotSupportedException(\"whisper.cpp CUDA build is not available for Linux ARM64.\");","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/WhisperDownloadService.cs#L148-L184","documentation":"Thrown by GetUrl inside the macOS architecture switch's default case. The switch handles Arm64 (M-series) and X64 (Intel) Macs, so any other ProcessArchitecture value (e.g. a future RISC-V/LoongArch port, or an unexpected value) hits this throw. It is narrower than the other macOS checks because the OS branch already matched.","triggerScenarios":"Calling DownloadWhisperCpp on macOS where RuntimeInformation.ProcessArchitecture is neither Arm64 nor X64 (e.g. a custom .NET runtime reporting Architecture.Wasm/Arm/x86).","commonSituations":"Rare on stock hardware; seen with non-standard .NET runtimes, emulated environments, or future CPU architectures not yet in the switch.","solutions":["Run on a mainstream macOS arch (Apple Silicon or Intel) where MacArmUrl/MacX64Url apply.","Add a case for the new architecture in the switch and point it at a matching build.","Fall back to the X64 build under Rosetta for unknown Apple architectures instead of throwing."],"exampleFix":"// before\nswitch (RuntimeInformation.ProcessArchitecture)\n{\n    case Architecture.Arm64: return MacArmUrl;\n    case Architecture.X64: return MacX64Url;\n    default: throw new PlatformNotSupportedException(\"Unsupported macOS architecture.\");\n}\n\n// after: Rosetta fallback for unknown arch\nswitch (RuntimeInformation.ProcessArchitecture)\n{\n    case Architecture.Arm64: return MacArmUrl;\n    case Architecture.X64:\n    default: return MacX64Url; // runs under Rosetta on Apple Silicon if needed\n}","handlingStrategy":"try-catch","validationCode":"var arch = RuntimeInformation.ProcessArchitecture;\nif (OperatingSystem.IsMacOS() && arch != Architecture.Arm64 && arch != Architecture.X64)\n{ /* unsupported macOS arch */ }","typeGuard":"static bool IsSupportedMacArch() =>\n    !OperatingSystem.IsMacOS() ||\n    RuntimeInformation.ProcessArchitecture is Architecture.Arm64 or Architecture.X64;","tryCatchPattern":"try { await svc.DownloadWhisperCpp(stream, progress, ct); }\ncatch (PlatformNotSupportedException ex) when (ex.Message.Contains(\"macOS architecture\"))\n{ /* fall back to MacX64Url under Rosetta */ }","preventionTips":["On macOS ensure the runtime reports Arm64 or X64.","Add a Rosetta fallback for unknown arches rather than throwing."],"tags":["platform","macos","whisper","download","architecture"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}