{"record":{"id":"ec7eaec22d674e66","repo":"jdx/mise","slug":"unsupported-os-supported-linux-macos-wind","errorCode":null,"errorMessage":"Unsupported OS '{}'. Supported: linux, macos, windows, android","messagePattern":"Unsupported OS '(.+?)'\\. Supported: linux, macos, windows, android","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/platform.rs","lineNumber":79,"sourceCode":"    }\n\n    pub(crate) fn libc(&self) -> Option<&str> {\n        self.qualifier\n            .as_deref()?\n            .split('-')\n            .find_map(|part| match part {\n                \"gnu\" | \"glibc\" => Some(\"gnu\"),\n                \"musl\" => Some(\"musl\"),\n                _ => None,\n            })\n    }\n\n    /// Validate that this platform is supported\n    pub(crate) fn validate(&self) -> Result<()> {\n        // Validate OS\n        match self.os.as_str() {\n            \"linux\" | \"macos\" | \"windows\" | \"android\" => {}\n            _ => bail!(\n                \"Unsupported OS '{}'. Supported: linux, macos, windows, android\",\n                self.os\n            ),\n        }\n\n        // Validate architecture\n        match self.arch.as_str() {\n            \"x64\" | \"arm64\" | \"x86\" | \"loongarch64\" | \"riscv64\" => {}\n            _ => bail!(\n                \"Unsupported architecture '{}'. Supported: x64, arm64, x86, loongarch64, riscv64\",\n                self.arch\n            ),\n        }\n\n        // Validate qualifier if present\n        if let Some(qualifier) = &self.qualifier {\n            match qualifier.as_str() {\n                \"gnu\" | \"glibc\" | \"musl\" | \"msvc\" | \"baseline\" | \"musl-baseline\" => {}","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/platform.rs#L61-L97","documentation":"Raised by Platform::validate when the parsed platform's OS field is not one of the supported values: linux, macos, windows, android. The platform string parsed successfully but names an OS this library has no support for.","triggerScenarios":"Calling validate() on a Platform built with os set to anything else — e.g. parse(\"freebsd-x64\") or parse(\"darwin-arm64\") — during tool platform selection or manifest matching.","commonSituations":"Using \"darwin\" instead of \"macos\"; naming a less common OS (freebsd, illumos, solaris); typos like \"linx\" or \"linux64\" leaking an OS-looking token into the os field; quoting 'osx' from another tool's convention.","solutions":["Use a supported OS name: linux, macos, windows, or android.","Replace \"darwin\" with \"macos\" and \"osx\" with \"macos\".","Fix typos in the platform string; check that the OS token isn't merged with the arch (e.g. \"linux64\" should be \"linux-x64\")."],"exampleFix":"// before\nplatform = \"darwin-arm64\"\n// after\nplatform = \"macos-arm64\"","handlingStrategy":"validation","validationCode":"const SUPPORTED_OS = new Set([\"linux\", \"macos\", \"windows\", \"android\"]);\nfunction validateOs(os) {\n  if (!SUPPORTED_OS.has(os)) throw new Error(`Unsupported OS \"${os}\"; use linux, macos, windows, or android`);\n}","typeGuard":"function isSupportedOs(os) {\n  return [\"linux\", \"macos\", \"windows\", \"android\"].includes(os);\n}","tryCatchPattern":"try {\n  platform.validate();\n} catch (e) {\n  if (String(e).startsWith(\"Unsupported OS\")) {\n    const aliases = { darwin: \"macos\", osx: \"macos\", mac: \"macos\", win: \"windows\", win32: \"windows\" };\n    throw new Error(`Use a supported OS name; e.g. \"${aliases[platform.os] || \"linux\"}\" instead of \"${platform.os}\".`);\n  } else throw e;\n}","preventionTips":["Translate common aliases: darwin/osx -> macos, win -> windows before validation.","Keep the supported-OS list visible wherever platform strings are authored.","Validate platform config in CI with the same rules the library enforces."],"tags":["platform","validation","unsupported-os","configuration"],"backgroundTag":"unsupported-platform","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}