{"record":{"id":"4259c911243a558f","repo":"dotnet/runtime","slug":"could-not-determine-jit-ee-version","errorCode":null,"errorMessage":"Could not determine JIT-EE version","messagePattern":"Could not determine JIT-EE version","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi_diffs_setup.py","lineNumber":232,"sourceCode":"        return 1\n\ndef build_partitions(partitions_dir, do_asmdiffs, bin_path, host_bitness):\n    mcs_path = os.path.join(bin_path, \"mcs.exe\" if is_windows else \"mcs\")\n    if is_macos:\n        # Hack: the target is arm64, but the build machine is x64. We build SPMI for x64 because of that,\n        # but it exists at a different path.\n        mcs_path = os.path.join(bin_path, \"..\", \"osx.x64.Checked\", \"mcs\")\n    assert(os.path.exists(mcs_path))\n\n    command = [mcs_path, \"-printJITEEVersion\"]\n    proc = subprocess.Popen(command, stdout=subprocess.PIPE)\n    stdout_jit_ee_version, _ = proc.communicate()\n    return_code = proc.returncode\n    if return_code == 0:\n        jit_ee_version = stdout_jit_ee_version.decode('utf-8').strip()\n        jit_ee_version = jit_ee_version.lower()\n    else:\n        raise Exception(\"Could not determine JIT-EE version\")\n\n    print(\"JIT-EE version determined to be {}\".format(jit_ee_version))\n\n    az_account_name = \"clrjit2\"\n    az_superpmi_container_name = \"superpmi\"\n    az_blob_storage_account_uri = \"https://\" + az_account_name + \".blob.core.windows.net/\"\n    az_blob_storage_superpmi_container_uri = az_blob_storage_account_uri + az_superpmi_container_name\n    az_collections_root_folder = \"collections\"\n    prefix = az_collections_root_folder + \"/\" + jit_ee_version\n    prefix_urlencoded = urllib.parse.quote(prefix)\n    list_superpmi_container_uri = az_blob_storage_superpmi_container_uri + \"?restype=container&comp=list&prefix=\" + prefix_urlencoded + \"/\"\n\n    try:\n        contents = urllib.request.urlopen(list_superpmi_container_uri).read().decode('utf-8')\n    except Exception as exception:\n        raise Exception(\"Didn't find any collections using %s\", list_superpmi_container_uri)\n\n    elem = ET.fromstring(contents)","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi_diffs_setup.py#L214-L250","documentation":"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.","triggerScenarios":"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`.","commonSituations":"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.","solutions":["Run `<mcs_path> -printJITEEVersion` by hand to see the real failure/stderr.","Rebuild CoreCLR so mcs is consistent with the host: `build.sh clr+libs -checked`.","Confirm mcs_path matches host_bitness/is_macos hack path and is executable on this machine.","If the flag changed, update the command in build_partitions."],"exampleFix":"// before\n# stale mcs -> raises [195]\n// after\n./build.sh clr+libs -checked -arch <host_arch>\n# then re-run; verify: <bin>/mcs -printJITEEVersion prints a GUID","handlingStrategy":"validation","validationCode":"import subprocess, os\nif not os.path.isfile(mcs_path):\n    raise SystemExit(f'mcs missing at {mcs_path}')\nrc = subprocess.run([mcs_path,'-printJITEEVersion']).returncode\nif rc != 0:\n    raise SystemExit(f'{mcs_path} -printJITEEVersion failed; rebuild CoreCLR Checked')","typeGuard":"def mcs_reports_version(mcs_path: str) -> bool:\n    import subprocess, os\n    return os.path.isfile(mcs_path) and subprocess.run([mcs_path,'-printJITEEVersion'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0","tryCatchPattern":"try:\n    build_partitions(...)\nexcept Exception as e:\n    if 'JIT-EE version' in str(e):\n        rebuild_coreclr_checked(); build_partitions(...)","preventionTips":["Rebuild CoreCLR Checked for the host arch before diffs","Run mcs -printJITEEVersion as a smoke test","Keep mcs and the JIT it loads consistent"],"tags":["build","mcs","superpmi","configuration"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}