{"record":{"id":"672358f43c5811eb","repo":"dotnet/runtime","slug":"core-root-not-set-properly","errorCode":null,"errorMessage":"Core_Root not set properly","messagePattern":"Core_Root not set properly","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":3750,"sourceCode":"    \"\"\" Determine the coredistools location in one of several locations:\n        1. First, look in Core_Root. It will be there if the setup-stress-dependencies.cmd/sh\n        script has been run, which is typically only if tests have been run.\n        2. The build appears to restore it and put it in the R2RDump sub-directory. Look there.\n        Copy it to the Core_Root directory if found.\n        3. If unable to find coredistools, download it from a cached\n        copy in the CLRJIT Azure Storage. (Ideally, we would instead download the NuGet\n        package and extract it using the same mechanism as setup-stress-dependencies\n        instead of having our own copy in Azure Storage).\n\n    Args:\n        coreclr_args (CoreclrArguments) : parsed args\n\n    Returns:\n        coredistools_location (str)     : path of [lib]coredistools.dylib|so|dll\n    \"\"\"\n\n    if not hasattr(coreclr_args, \"core_root\") or coreclr_args.core_root is None:\n        raise RuntimeError(\"Core_Root not set properly\")\n\n    coredistools_dll_name = None\n    if coreclr_args.host_os.lower() == \"osx\":\n        coredistools_dll_name = \"libcoredistools.dylib\"\n    elif coreclr_args.host_os.lower() == \"linux\":\n        coredistools_dll_name = \"libcoredistools.so\"\n    elif coreclr_args.host_os.lower() == \"windows\":\n        coredistools_dll_name = \"coredistools.dll\"\n    else:\n        raise RuntimeError(\"Unknown host os: {}\".format(coreclr_args.host_os))\n\n    coredistools_location = os.path.join(coreclr_args.core_root, coredistools_dll_name)\n    if os.path.isfile(coredistools_location):\n        logging.info(\"Using coredistools found at %s\", coredistools_location)\n    else:\n        coredistools_r2rdump_location = os.path.join(coreclr_args.core_root, \"R2RDump\", coredistools_dll_name)\n        if os.path.isfile(coredistools_r2rdump_location):\n            logging.info(\"Using coredistools found at %s (copying to %s)\", coredistools_r2rdump_location, coredistools_location)","sourceCodeStart":3732,"sourceCodeEnd":3768,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L3732-L3768","documentation":"Raised at the top of `determine_coredistools` (superpmi.py:3749-3750). coredistools (the native disassembler used for asm diffs) is resolved relative to Core_Root, so if coreclr_args has no `core_root` attribute or it is None, the function cannot proceed and aborts. Core_Root is the built runtime output directory.","triggerScenarios":"Invoking an asmdiffs/replay path that needs coredistools without a resolvable Core_Root: `-core_root` not passed AND not deducible from the runtime repo layout. The check fires before any OS-specific coredistools lookup.","commonSituations":"Running outside a runtime repo checkout with no explicit `-core_root`; running on a machine where the repo root deduction fails; invoking asm diffs against only a standalone clrjit without a Core_Root.","solutions":["Pass `-core_root <path-to-built-runtime>` explicitly on the command line.","Run from within a runtime repo checkout so Core_Root can be deduced, or run the build step that creates Core_Root first.","If doing a product-build-only diff, ensure the product location/Core_Root is created by the runtime build."],"exampleFix":"// before\nsuperpmi.py asmdiffs -mch_files foo.mch ...\n// after\nsuperpmi.py asmdiffs -core_root artifacts/bin/coreclr/windows.x64.Debug -mch_files foo.mch ...","handlingStrategy":"validation","validationCode":"# Require a usable Core_Root before any coredistools-dependent flow\ncore_root = getattr(coreclr_args, 'core_root', None)\nif not core_root:\n    raise SystemExit('Core_Root not set; pass -core_root <path> or run inside a runtime repo checkout.')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass -core_root for asm diffs in non-repo contexts.","Run from within a runtime repo checkout to enable deduction."],"tags":["core-root","config","superpmi","asmdiffs"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}