{"record":{"id":"1a0f2b4a47e408b1","repo":"dotnet/runtime","slug":"tool-tool-name-not-found-have-you-built-the-run","errorCode":null,"errorMessage":"Tool {tool_name} not found. Have you built the runtime repo and created a Core_Root, or put it on your PATH?","messagePattern":"Tool (.+?) not found\\. Have you built the runtime repo and created a Core_Root, or put it on your PATH\\?","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":3882,"sourceCode":"    # Next, look in the built product directory, if it exists. We can use superpmi/mcs directly from the\n    # product build directory instead from Core_Root because they don't depend on managed code libraries.\n    if search_product_location and hasattr(coreclr_args, \"product_location\") and coreclr_args.product_location is not None and os.path.isdir(coreclr_args.product_location):\n        tool_path = os.path.join(coreclr_args.product_location, tool_name)\n        if os.path.isfile(tool_path):\n            logging.debug(\"Using %s from product build location: %s\", tool_name, tool_path)\n            return tool_path\n\n    # Finally, look on the PATH\n    if search_path:\n        path_var = os.environ.get(\"PATH\")\n        if path_var is not None:\n            tool_path = find_file(tool_name, path_var.split(os.pathsep))\n            if tool_path is not None:\n                logging.debug(\"Using %s from PATH: %s\", tool_name, tool_path)\n                return tool_path\n\n    if throw_on_not_found:\n        raise RuntimeError(\"Tool \" + tool_name + \" not found. Have you built the runtime repo and created a Core_Root, or put it on your PATH?\")\n\n    return None\n\n\ndef determine_superpmi_tool_name(coreclr_args):\n    \"\"\" Determine the superpmi tool name based on the OS\n\n    Args:\n        coreclr_args (CoreclrArguments): parsed args\n\n    Return:\n        (str) Name of the superpmi tool to use\n    \"\"\"\n\n    if coreclr_args.host_os == \"osx\" or coreclr_args.host_os == \"linux\":\n        return \"superpmi\"\n    elif coreclr_args.host_os == \"windows\":\n        return \"superpmi.exe\"","sourceCodeStart":3864,"sourceCodeEnd":3900,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L3864-L3900","documentation":"Raised in `find_tool` (superpmi.py:3881-3882) when throw_on_not_found is True and a required tool (superpmi, mcs, dotnet, etc.) was not found in Core_Root, the product build location, or on PATH. The tool must exist somewhere discoverable for the script to invoke it.","triggerScenarios":"Any flow that calls find_tool with throw_on_not_found=True when the named binary is absent from all three search locations. E.g. running replay/asmdiffs without having built the runtime or put superpmi/mcs on PATH.","commonSituations":"Fresh clone where the runtime hasn't been built; a build that didn't produce Core_Root; PATH not including the jitutils `bin` directory; building only a subset of components so the tool wasn't emitted.","solutions":["Build the runtime repo and create a Core_Root (the build emits superpmi/mcs), then re-run.","Build jitutils and add its `bin` directory to PATH so the tools resolve.","Pass `-core_root` / `-product_location` pointing at a location that already contains the tool."],"exampleFix":"// before\nsuperpmi.py replay -mch_files foo.mch ...   # nothing built yet\n// after\n# build runtime first, then:\nsuperpmi.py replay -core_root artifacts/bin/coreclr/<os>.<arch>.Release -mch_files foo.mch ...","handlingStrategy":"validation","validationCode":"import shutil\ndef tool_available(name, core_root=None):\n    if core_root and os.path.isfile(os.path.join(core_root, name)):\n        return True\n    return shutil.which(name) is not None\nfor t in ('superpmi', 'mcs'):\n    if not tool_available(t, coreclr_args.core_root):\n        raise SystemExit(f'{t} not found; build the runtime/Core_Root or add jitutils bin to PATH.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the runtime and create Core_Root before running superpmi flows.","Add the jitutils bin directory to PATH."],"tags":["tooling","build","config","superpmi"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}