dotnet/runtime · error · RuntimeError

Invalid OS for x64.

Error message

Invalid OS for x64.

What it means

Raised by determine_benchmark_machine() at src/coreclr/scripts/superpmi_aspnet.py:106 when arch is 'x64' but host_os is neither 'windows' nor 'linux'. The crank/TechEmpower benchmark machines (aspnet-perf-win, aspnet-perf-lin) only exist for x64 Windows and x64 Linux.

Solutions

  1. Run the x64 aspnet collection on Windows or Linux.
  2. Use a remote Windows/Linux Helix crank target instead of a local macOS run.
Defensive patterns

Strategy: validation

Validate before calling

if coreclr_args.arch == 'x64' and coreclr_args.host_os not in ('windows', 'linux'):
    raise SystemExit('x64 aspnet benchmark collection requires Windows or Linux host')

Prevention

When it happens

Trigger: Invoking superpmi_aspnet.py with -arch x64 on macOS or another unsupported OS.

Common situations: Attempting to run the aspnet crank benchmark collection from a macOS developer machine.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/3dddf15f7f2bf71c. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/superpmi_aspnet.py:106

#
def determine_benchmark_machine(coreclr_args):
    """ Determine the name of the benchmark machine to use

    Args:
        coreclr_args (CoreclrArguments): parsed args

    Return:
        (str) : name of the benchmnark machine
    """

    if coreclr_args.arch == "x64":
        if coreclr_args.host_os == "windows":
            return "aspnet-perf-win"
#            return "aspnet-citrine-win"
        elif coreclr_args.host_os == "linux":
            return "aspnet-perf-lin"
        else:
            raise RuntimeError("Invalid OS for x64.")
    elif coreclr_args.arch == "arm64":
        if coreclr_args.host_os == "linux":
            return "aspnet-citrine-arm"
        else:
            raise RuntimeError("Invalid OS for arm64.")
    else:
        raise RuntimeError("Invalid arch.")

def build_and_run(coreclr_args):
    """Run perf scenarios under crank and collect data with SPMI"

    Args:
        coreclr_args (CoreClrArguments): Arguments use to drive
        output_mch_name (string): Name of output mch file name
    """
    source_directory = coreclr_args.source_directory
    target_arch = coreclr_args.arch
    target_os = coreclr_args.host_os

View on GitHub (pinned to 60108ba66e)