dotnet/runtime · error · Exception

Could not determine JIT-EE version

Error message

Could not determine JIT-EE version

What it means

Raised by build_partitions in superpmi_diffs_setup.py when `mcs -printJITEEVersion` exits non-zero. The JIT-EE version GUID is required to locate the matching MCH collections in Azure blob storage.

Source

Thrown at src/coreclr/scripts/superpmi_diffs_setup.py:232

        return 1

def build_partitions(partitions_dir, do_asmdiffs, bin_path, host_bitness):
    mcs_path = os.path.join(bin_path, "mcs.exe" if is_windows else "mcs")
    if is_macos:
        # Hack: the target is arm64, but the build machine is x64. We build SPMI for x64 because of that,
        # but it exists at a different path.
        mcs_path = os.path.join(bin_path, "..", "osx.x64.Checked", "mcs")
    assert(os.path.exists(mcs_path))

    command = [mcs_path, "-printJITEEVersion"]
    proc = subprocess.Popen(command, stdout=subprocess.PIPE)
    stdout_jit_ee_version, _ = proc.communicate()
    return_code = proc.returncode
    if return_code == 0:
        jit_ee_version = stdout_jit_ee_version.decode('utf-8').strip()
        jit_ee_version = jit_ee_version.lower()
    else:
        raise Exception("Could not determine JIT-EE version")

    print("JIT-EE version determined to be {}".format(jit_ee_version))

    az_account_name = "clrjit2"
    az_superpmi_container_name = "superpmi"
    az_blob_storage_account_uri = "https://" + az_account_name + ".blob.core.windows.net/"
    az_blob_storage_superpmi_container_uri = az_blob_storage_account_uri + az_superpmi_container_name
    az_collections_root_folder = "collections"
    prefix = az_collections_root_folder + "/" + jit_ee_version
    prefix_urlencoded = urllib.parse.quote(prefix)
    list_superpmi_container_uri = az_blob_storage_superpmi_container_uri + "?restype=container&comp=list&prefix=" + prefix_urlencoded + "/"

    try:
        contents = urllib.request.urlopen(list_superpmi_container_uri).read().decode('utf-8')
    except Exception as exception:
        raise Exception("Didn't find any collections using %s", list_superpmi_container_uri)

    elem = ET.fromstring(contents)

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Run `<mcs_path> -printJITEEVersion` by hand to see the real failure/stderr.
  2. Rebuild CoreCLR so mcs is consistent with the host: `build.sh clr+libs -checked`.
  3. Confirm mcs_path matches host_bitness/is_macos hack path and is executable on this machine.
  4. If the flag changed, update the command in build_partitions.

Example fix

// before
# stale mcs -> raises [195]
// after
./build.sh clr+libs -checked -arch <host_arch>
# then re-run; verify: <bin>/mcs -printJITEEVersion prints a GUID
Defensive patterns

Strategy: validation

Validate before calling

import subprocess, os
if not os.path.isfile(mcs_path):
    raise SystemExit(f'mcs missing at {mcs_path}')
rc = subprocess.run([mcs_path,'-printJITEEVersion']).returncode
if rc != 0:
    raise SystemExit(f'{mcs_path} -printJITEEVersion failed; rebuild CoreCLR Checked')

Type guard

def mcs_reports_version(mcs_path: str) -> bool:
    import subprocess, os
    return os.path.isfile(mcs_path) and subprocess.run([mcs_path,'-printJITEEVersion'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0

Try / catch

try:
    build_partitions(...)
except Exception as e:
    if 'JIT-EE version' in str(e):
        rebuild_coreclr_checked(); build_partitions(...)

Prevention

When it happens

Trigger: mcs_path does not exist or is not executable (the assert above passed but the binary is corrupt/missing deps), or mcs crashed printing the GUID. Triggered via `subprocess.Popen([mcs_path,'-printJITEEVersion']).returncode != 0`.

Common situations: Stale/partial CoreCLR build where mcs exists but its native deps are missing; cross-arch mcs that can't run on this host; mcs built for a different OS; the `-printJITEEVersion` flag was removed/renamed in the mcs binary.

Related errors


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