{"record":{"id":"cdcd0698429b5aad","repo":"dotnet/runtime","slug":"unknown-os","errorCode":null,"errorMessage":"Unknown OS.","messagePattern":"Unknown OS\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/jitrollingbuild.py","lineNumber":414,"sourceCode":"    # and so on, and live in the same product directory as the primary JIT.\n    #\n    # Note that the expression below explicitly filters out the primary JIT since we added that above.\n    # We handle the primary JIT specially so we can error if it is missing. For the cross-compilation\n    # JITs, we don't bother trying to ensure that all the ones we might expect are actually there.\n    #\n    # We don't do a recursive walk because the JIT is also copied to the \"sharedFramework\" subdirectory,\n    # so we don't want to pick that up.\n\n    if coreclr_args.host_os == \"osx\":\n        allowed_extensions = [ \".dylib\" ]\n        # Add .dwarf for debug info\n    elif coreclr_args.host_os == \"linux\":\n        allowed_extensions = [ \".so\" ]\n        # Add .dbg for debug info\n    elif coreclr_args.host_os == \"windows\":\n        allowed_extensions = [ \".dll\" ]\n    else:\n        raise RuntimeError(\"Unknown OS.\")\n\n    cross_jit_paths = [os.path.join(coreclr_args.product_location, item)\n                       for item in os.listdir(coreclr_args.product_location)\n                       if re.match(r'.*clrjit.*', item) and item != jit_name and any(item.endswith(extension) for extension in allowed_extensions)]\n    files += cross_jit_paths\n\n    # On Windows, grab the PDB files from a sub-directory.\n    # if coreclr_args.host_os == \"windows\":\n    #    pdb_dir = os.path.join(coreclr_args.product_location, \"PDB\")\n    #    if os.path.isdir(pdb_dir):\n    #        pdb_paths = [os.path.join(pdb_dir, item) for item in os.listdir(pdb_dir) if re.match(r'.*clrjit.*', item)]\n    #        files += pdb_paths\n\n    # Figure out which git hash to use for the upload. By default, it is the required coreclr_args.git_hash argument.\n    # However, if \"--use_latest_jit_change\" is passed, we look backwards in the git log for the nearest git commit\n    # with a JIT change (it could, and often will be, the same as the argument git_hash).\n    jit_git_hash = coreclr_args.git_hash\n","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/dotnet/runtime/blob/b7130aa5e416e88ac48fafe92bf56a9d64e13c97/src/coreclr/scripts/jitrollingbuild.py#L396-L432","documentation":"Raised by upload_command() when coreclr_args.host_os is not one of 'osx', 'linux', or 'windows'. The OS determines the allowed file extensions used to find cross-compilation JITs (.dylib/.so/.dll), so an unrecognized OS means the upload file enumeration cannot proceed.","triggerScenarios":"Calling 'jitrollingbuild.py upload' with -host_os set to an unsupported value (e.g. 'freebsd', 'mac', 'win', or an empty/None value after the default-detection path). The branch is at jitrollingbuild.py:405-414.","commonSituations":"Typo in -host_os; passing an OS alias the script doesn't recognize; running on an OS where host_os auto-detection in coreclr_arguments returns something unexpected; copy-pasting a target_os value into host_os.","solutions":["Pass -host_os as exactly one of: windows, linux, osx.","If you omitted -host_os, inspect what coreclr_arguments auto-detected and override it explicitly.","Check for trailing whitespace or case issues in the argument (the comparison is case-sensitive and exact)."],"exampleFix":"// before\njitrollingbuild.py upload -git_hash <sha> -host_os mac\n// after\njitrollingbuild.py upload -git_hash <sha> -host_os osx","handlingStrategy":"type-guard","validationCode":"if coreclr_args.host_os not in (\"windows\", \"linux\", \"osx\"):\n    raise SystemExit(\"-host_os must be one of windows, linux, osx\")","typeGuard":"def is_supported_host_os(value: str) -> bool:\n    return value in (\"windows\", \"linux\", \"osx\")","tryCatchPattern":"null","preventionTips":["Always pass -host_os from the canonical set.","Normalize platform.system()/sys.platform to windows/linux/osx before use.","Add an argparse choices=[...] constraint if extending the script."],"tags":["upload","os","configuration","validation"],"analyzedSha":"b7130aa5e416e88ac48fafe92bf56a9d64e13c97","analyzedAt":"2026-08-07T06:17:13.108Z","schemaVersion":2},"datasetVersion":"2026-08-07T15:17:06.553Z"}