{"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/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/jitrollingbuild.py#L396-L432","documentation":"Raised by upload_command in jitrollingbuild.py when computing the set of allowed cross-JIT file extensions. The if/elif chain only handles host_os == 'osx', 'linux', and 'windows'; any other value falls to the else branch and raises 'Unknown OS.' This guards the cross-compilation JIT enumeration step of the upload.","triggerScenarios":"Invoking `jitrollingbuild.py upload` with -host_os set to a value other than windows/osx/linux (e.g. typo like 'mac', 'win', 'Unix', or an unsupported platform string).","commonSituations":"Typos in -host_os; passing a capitalized variant like 'Windows' or 'Linux' when the script expects lowercase; using a platform the rolling-build uploader was never taught.","solutions":["Pass -host_os as one of the exact lowercase values: windows, osx, or linux.","Omit -host_os entirely so it defaults to the detected current OS.","If you genuinely need another OS, the script must be extended to handle it before this branch is reached."],"exampleFix":"// before\npython jitrollingbuild.py upload -git_hash abc -host_os mac   # 'Unknown OS.'\n// after\npython jitrollingbuild.py upload -git_hash abc -host_os osx","handlingStrategy":"validation","validationCode":"VALID = {\"windows\", \"osx\", \"linux\"}\nif host_os not in VALID:\n    raise SystemExit(f\"-host_os must be one of {sorted(VALID)}, got {host_os!r}\")","typeGuard":"def is_supported_upload_os(s: str) -> bool:\n    return s in {\"windows\", \"osx\", \"linux\"}","tryCatchPattern":null,"preventionTips":["Normalize host_os to lowercase before passing.","Let the script auto-detect host_os by omitting the flag unless you must override."],"tags":["jit-rolling-build","upload","os-detection","argument-validation","python"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}