{"record":{"id":"5ab356f79514e121","repo":"dotnet/runtime","slug":"unknown-os-5ab356","errorCode":null,"errorMessage":"Unknown OS.","messagePattern":"Unknown OS\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi_aspnet.py","lineNumber":84,"sourceCode":"def determine_native_name(coreclr_args, base_lib_name, target_os):\n    \"\"\" Determine the name of the native lib based on the OS.\n\n    Args:\n        coreclr_args (CoreclrArguments): parsed args\n        base_lib_name (str) : root name of the lib\n        target_os (str) : os to run tests on\n    Return:\n        (str) : name of the native lib for this OS\n    \"\"\"\n\n    if target_os == \"osx\":\n        return \"lib\" + base_lib_name + \".dylib\"\n    elif target_os == \"linux\":\n        return \"lib\" + base_lib_name + \".so\"\n    elif target_os == \"windows\":\n        return base_lib_name + \".dll\"\n    else:\n        raise RuntimeError(\"Unknown OS.\")\n\n# Where there is an option, we generally target the less performant machines\n# See https://github.com/aspnet/Benchmarks/tree/master/scenarios\n#\ndef determine_benchmark_machine(coreclr_args):\n    \"\"\" Determine the name of the benchmark machine to use\n\n    Args:\n        coreclr_args (CoreclrArguments): parsed args\n\n    Return:\n        (str) : name of the benchmnark machine\n    \"\"\"\n\n    if coreclr_args.arch == \"x64\":\n        if coreclr_args.host_os == \"windows\":\n            return \"aspnet-perf-win\"\n#            return \"aspnet-citrine-win\"","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi_aspnet.py#L66-L102","documentation":"Raised by determine_native_name() in superpmi_aspnet.py when target_os is not one of 'osx', 'linux', or 'windows'. The function maps the OS to the native library suffix (.dylib/.so/.dll) at src/coreclr/scripts/superpmi_aspnet.py:84 and has no mapping for any other value.","triggerScenarios":"Calling determine_native_name() with a target_os other than osx/linux/windows (e.g. 'freebsd', 'browser', or an empty/unnormalized string).","commonSituations":"Running the aspnet SuperPMI collection on an unsupported host OS, or passing a target_os derived from platform.system() (e.g. 'Darwin', 'Windows') that was not normalized to the expected lowercase token.","solutions":["Pass target_os as exactly 'osx', 'linux', or 'windows'.","Normalize platform.system() output before calling (map 'Darwin' -> 'osx', 'Windows' -> 'windows', 'Linux' -> 'linux').","Run the script on a supported OS."],"exampleFix":"// before\ndetermine_native_name(coreclr_args, \"coreclr\", \"Darwin\")\n// after\ndetermine_native_name(coreclr_args, \"coreclr\", \"osx\")","handlingStrategy":"validation","validationCode":"supported = {'osx', 'linux', 'windows'}\nif target_os not in supported:\n    raise ValueError(f\"target_os must be one of {sorted(supported)}, got {target_os!r}\")","typeGuard":"def is_supported_os(target_os: str) -> bool:\n    return target_os in ('osx', 'linux', 'windows')","tryCatchPattern":null,"preventionTips":["Normalize host OS strings (platform.system()) to the three supported tokens before calling determine_native_name()."],"tags":["dotnet","coreclr","superpmi","os-detection","configuration"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}