{"record":{"id":"7f43e02fe2bfb42a","repo":"dotnet/runtime","slug":"unknown-os-7f43e0","errorCode":null,"errorMessage":"Unknown OS.","messagePattern":"Unknown OS\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":3902,"sourceCode":"    return None\n\n\ndef determine_superpmi_tool_name(coreclr_args):\n    \"\"\" Determine the superpmi tool name based on the OS\n\n    Args:\n        coreclr_args (CoreclrArguments): parsed args\n\n    Return:\n        (str) Name of the superpmi tool to use\n    \"\"\"\n\n    if coreclr_args.host_os == \"osx\" or coreclr_args.host_os == \"linux\":\n        return \"superpmi\"\n    elif coreclr_args.host_os == \"windows\":\n        return \"superpmi.exe\"\n    else:\n        raise RuntimeError(\"Unknown OS.\")\n\n\ndef determine_superpmi_tool_path(coreclr_args):\n    \"\"\" Determine the superpmi tool full path\n\n    Args:\n        coreclr_args (CoreclrArguments): parsed args\n\n    Return:\n        (str) Path of the superpmi tool to use\n    \"\"\"\n\n    superpmi_tool_name = determine_superpmi_tool_name(coreclr_args)\n    return find_tool(coreclr_args, superpmi_tool_name)\n\n\ndef determine_mcs_tool_name(coreclr_args):\n    \"\"\" Determine the mcs tool name based on the OS","sourceCodeStart":3884,"sourceCodeEnd":3920,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L3884-L3920","documentation":"Raised by determine_superpmi_tool_name when coreclr_args.host_os is none of osx, linux, or windows. SuperPMI ships as 'superpmi' on Unix and 'superpmi.exe' on Windows; for any other host_os there is no published binary name, so name resolution fails before any filesystem search.","triggerScenarios":"Called via determine_superpmi_tool_path during startup of most SuperPMI modes; the host_os branch chain (osx/linux -> 'superpmi', windows -> 'superpmi.exe', else -> raise). Triggered when host_os is a non-desktop value such as freebsd/browser/wasi/android or an unrecognized/misspelled string.","commonSituations":"Running on an unsupported host OS; auto-detection picked a tier-2 OS (e.g. freebsd, illumos); an explicit --host_os override with an unsupported value; cross-target scenarios where host_os leaked from target_os.","solutions":["Run SuperPMI on a supported host OS (Windows, Linux, or macOS).","Verify and override the detected OS with --host_os windows|linux|osx if you are actually running on one of those.","If you need SuperPMI on a new OS, build the superpmi native tool for that platform upstream."],"exampleFix":"// before\nif coreclr_args.host_os == \"osx\" or coreclr_args.host_os == \"linux\":\n    return \"superpmi\"\nelif coreclr_args.host_os == \"windows\":\n    return \"superpmi.exe\"\nelse:\n    raise RuntimeError(\"Unknown OS.\")\n// after (fix invocation)\npython superpmi.py <mode> --host_os linux ...","handlingStrategy":"validation","validationCode":"SUPPORTED = {'osx', 'linux', 'windows'}\ndef validate_host_os_for_superpmi(host_os):\n    if host_os not in SUPPORTED:\n        raise RuntimeError(f\"superpmi tool only ships for {sorted(SUPPORTED)}; got '{host_os}'. Run on a supported host OS or pass --host_os.\")","typeGuard":"def is_superpmi_supported_os(host_os: str) -> bool:\n    return isinstance(host_os, str) and host_os in {'osx', 'linux', 'windows'}","tryCatchPattern":null,"preventionTips":["Run SuperPMI on Windows, Linux, or macOS only.","Pass --host_os explicitly if auto-detection yields a tier-2 OS.","For new platforms, build the superpmi native binary upstream first."],"tags":["host-os","platform","tool-resolution","superpmi"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}