dotnet/runtime · error · RuntimeError

Unknown OS.

Error message

Unknown OS.

What it means

Raised in `determine_superpmi_tool_name` (superpmi.py:3901-3902) when host_os is not osx, linux, or windows. The superpmi binary name (superpmi / superpmi.exe) is only defined for those three; any other host_os has no known superpmi executable name.

Source

Thrown at src/coreclr/scripts/superpmi.py:3902

    return None


def determine_superpmi_tool_name(coreclr_args):
    """ Determine the superpmi tool name based on the OS

    Args:
        coreclr_args (CoreclrArguments): parsed args

    Return:
        (str) Name of the superpmi tool to use
    """

    if coreclr_args.host_os == "osx" or coreclr_args.host_os == "linux":
        return "superpmi"
    elif coreclr_args.host_os == "windows":
        return "superpmi.exe"
    else:
        raise RuntimeError("Unknown OS.")


def determine_superpmi_tool_path(coreclr_args):
    """ Determine the superpmi tool full path

    Args:
        coreclr_args (CoreclrArguments): parsed args

    Return:
        (str) Path of the superpmi tool to use
    """

    superpmi_tool_name = determine_superpmi_tool_name(coreclr_args)
    return find_tool(coreclr_args, superpmi_tool_name)


def determine_mcs_tool_name(coreclr_args):
    """ Determine the mcs tool name based on the OS

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Run on a supported host OS (linux, osx, windows) where superpmi is built.
  2. Do not override host_os to an unsupported value; allow auto-detection.
  3. If cross-targeting, keep host_os as the supported build host and only set target_os.
Defensive patterns

Strategy: validation

Validate before calling

supported = {'osx', 'linux', 'windows'}
if coreclr_args.host_os not in supported:
    raise SystemExit(f'superpmi tool only defined for {sorted(supported)}; got {coreclr_args.host_os}')

Prevention

When it happens

Trigger: coreclr_args.host_os resolves to a value outside {osx, linux, windows} (e.g. freebsd, illumos, browser, wasi) and a flow needs the superpmi tool name. The OS switch has no case for other platforms.

Common situations: Explicitly setting host/target OS to an unsupported platform; running on an OS where superpmi is not built; cross-compiling to browser/wasi/android targets while invoking superpmi on the host.

Related errors


AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06). Data as JSON: /api/errors/7f43e02fe2bfb42a. Report an issue: GitHub.