{"record":{"id":"c495c8ae29d59776","repo":"dotnet/runtime","slug":"unsupported-os","errorCode":null,"errorMessage":"Unsupported OS.","messagePattern":"Unsupported OS\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":693,"sourceCode":"\n        Args:\n            coreclr_args (CoreclrArguments) : parsed args\n\n        \"\"\"\n\n        self.core_root = coreclr_args.core_root\n\n        if coreclr_args.host_os == \"osx\":\n            self.collection_shim_name = \"libsuperpmi-shim-collector.dylib\"\n            self.corerun_tool_name = \"corerun\"\n        elif coreclr_args.host_os == \"linux\":\n            self.collection_shim_name = \"libsuperpmi-shim-collector.so\"\n            self.corerun_tool_name = \"corerun\"\n        elif coreclr_args.host_os == \"windows\":\n            self.collection_shim_name = \"superpmi-shim-collector.dll\"\n            self.corerun_tool_name = \"corerun.exe\"\n        else:\n            raise RuntimeError(\"Unsupported OS.\")\n\n        self.collection_shim_path = os.path.join(self.core_root, self.collection_shim_name)\n\n        jit_name = get_jit_name(coreclr_args)\n        self.jit_path = os.path.join(coreclr_args.core_root, jit_name)\n\n        self.superpmi_path = determine_superpmi_tool_path(coreclr_args)\n        self.mcs_path = determine_mcs_tool_path(coreclr_args)\n\n        self.collection_command = coreclr_args.collection_command\n        self.collection_args = coreclr_args.collection_args\n\n        if coreclr_args.pmi:\n            self.pmi_location = determine_pmi_location(coreclr_args)\n            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)\n\n        if coreclr_args.crossgen2:\n            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)","sourceCodeStart":675,"sourceCodeEnd":711,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L675-L711","documentation":"Thrown by SuperPMICollect.__init__() in superpmi.py when coreclr_args.host_os is not 'osx', 'linux', or 'windows'. The host OS determines the name of the SuperPMI collection shim shared library (e.g., libsuperpmi-shim-collector.so vs superpmi-shim-collector.dll), and an unrecognized OS means the shim filename cannot be determined.","triggerScenarios":"In SuperPMICollect.__init__() at lines 683-693: the if/elif chain checks host_os for 'osx', 'linux', 'windows' to set collection_shim_name and corerun_tool_name. If none match, line 693 raises. This is triggered when running 'superpmi.py collect' with an unsupported OS.","commonSituations":"Running on an unsupported OS (e.g., FreeBSD). The -host_os argument is misspelled or set to an invalid value. Platform auto-detection returned an unexpected string (e.g., 'darwin' instead of 'osx', though the detection logic should handle this).","solutions":["Check -host_os and ensure it is exactly 'windows', 'linux', or 'osx'.","Verify the auto-detected OS by checking what CoreclrArguments populates for host_os.","If you genuinely need SuperPMI on a new OS, add the appropriate shim name and corerun tool name in the if/elif chain."],"exampleFix":"# before: unsupported host OS\npython superpmi.py collect -host_os darwin\n\n# after: use correct OS identifier\npython superpmi.py collect -host_os osx","handlingStrategy":"validation","validationCode":"# Validate host_os before constructing SuperPMICollect\nvalid_oses = {'osx', 'linux', 'windows'}\nif coreclr_args.host_os not in valid_oses:\n    raise ValueError(f'Unsupported OS for SuperPMI collect: {coreclr_args.host_os}. Must be one of: {valid_oses}')","typeGuard":"def is_supported_superpmi_os(host_os: str) -> bool:\n    return host_os in {'osx', 'linux', 'windows'}","tryCatchPattern":"try:\n    collector = SuperPMICollect(coreclr_args)\nexcept RuntimeError as e:\n    if 'Unsupported OS' in str(e):\n        logging.error('SuperPMI collect supports windows, linux, and osx only')\n        sys.exit(1)\n    raise","preventionTips":["Use exactly 'windows', 'linux', or 'osx' for -host_os.","Let the script auto-detect the OS by omitting -host_os.","SuperPMI collection shims only exist for the three supported desktop/server OSes."],"tags":["superpmi","validation","os-detection","collect","shim"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}