{"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/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi_diffs_setup.py#L214-L250","documentation":"Raised by superpmi_diffs_setup.py build_partitions() at src/coreclr/scripts/superpmi_diffs_setup.py:232 when `mcs -printJITEEVersion` returns a non-zero exit code. mcs (method context sorter) is expected to print the JIT-EE version string used to locate the matching baseline collection in Azure blob storage.","triggerScenarios":"The mcs binary is missing/corrupt, fails to run on the host, or returns non-zero from -printJITEEVersion; bin_path points to the wrong directory.","commonSituations":"CoreCLR Checked build not produced for the target; wrong bin_path; running an mcs built for a different OS/arch; missing shared libraries required by mcs.","solutions":["Confirm mcs exists at bin_path (and the osx.x64.Checked override path on macOS).","Rebuild coreclr Checked for the target OS/arch so mcs is fresh.","Run `mcs -printJITEEVersion` manually to see the real failure (missing .so/.dll, segfault).","Ensure bin_path matches the build output layout."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import os, subprocess\nmcs_path = os.path.join(bin_path, 'mcs.exe' if is_windows else 'mcs')\nif not os.path.isfile(mcs_path):\n    raise SystemExit(f'mcs not found at {mcs_path} — build coreclr Checked first')\nrc = subprocess.run([mcs_path, '-printJITEEVersion']).returncode\nif rc != 0:\n    raise SystemExit(f'mcs -printJITEEVersion exited {rc} — inspect the binary')","typeGuard":null,"tryCatchPattern":"try:\n    jit_ee_version = subprocess.check_output([mcs_path, '-printJITEEVersion'], text=True).strip().lower()\nexcept subprocess.CalledProcessError:\n    raise RuntimeError('Could not determine JIT-EE version')","preventionTips":["Run `mcs -printJITEEVersion` manually on the agent before relying on build_partitions().","Confirm mcs is built for the host OS/arch."],"tags":["dotnet","coreclr","superpmi","mcs","build","configuration"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}