{"record":{"id":"f027f78561161437","repo":"dotnet/runtime","slug":"couldn-t-determine-list-of-jit-changes-starting-wi-f027f7","errorCode":null,"errorMessage":"Couldn't determine list of JIT changes starting with baseline hash","messagePattern":"Couldn't determine list of JIT changes starting with baseline hash","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":4910,"sourceCode":"                raise RuntimeError(\"Couldn't determine baseline git hash\")\n\n            baseline_hash = stdout_git_merge_base.decode('utf-8').strip()\n            logging.info(\"Baseline hash: %s\", baseline_hash)\n        else:\n            baseline_hash = coreclr_args.base_git_hash\n\n        if coreclr_args.base_git_hash is None:\n            # Enumerate the last 20 changes, starting with the baseline, that included JIT and JIT-EE GUID changes.\n            command = [ \"git\", \"log\", \"--pretty=format:%H\", baseline_hash, \"-20\", \"--\", \"src/coreclr/jit/*\", \"src/coreclr/inc/jiteeversionguid.h\" ]\n            logging.debug(\"Invoking: %s\", \" \".join(command))\n            proc = subprocess.Popen(command, stdout=subprocess.PIPE)\n            stdout_change_list, _ = proc.communicate()\n            return_code = proc.returncode\n            change_list_hashes = []\n            if return_code == 0:\n                change_list_hashes = stdout_change_list.decode('utf-8').strip().splitlines()\n            else:\n                raise RuntimeError(\"Couldn't determine list of JIT changes starting with baseline hash\")\n\n            if len(change_list_hashes) == 0:\n                raise RuntimeError(\"No JIT changes found starting with baseline hash\")\n        else:\n            # If `-base_git_hash` is specified, then we use exactly that hash and no other for the baseline.\n            change_list_hashes = [ coreclr_args.base_git_hash ]\n\n        # For each hash, (1) see if we have the JIT already, and if not (2) try to download the corresponding JIT from the rolling build.\n\n        hashnum = 1\n        for git_hash in change_list_hashes:\n            logging.debug(\"%s: %s\", hashnum, git_hash)\n\n            jit_name = get_jit_name(coreclr_args)\n            basejit_dir = os.path.join(default_basejit_root_dir, \"{}.{}.{}.{}\".format(git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type))\n            basejit_path = os.path.join(basejit_dir, jit_name)\n            if os.path.isfile(basejit_path):\n                # We found this baseline JIT in our cache; use it!","sourceCodeStart":4892,"sourceCodeEnd":4928,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L4892-L4928","documentation":"Raised by determine_base_jit when 'git log --pretty=format:%H <baseline_hash> -20 -- <jit paths>' returns nonzero. This command enumerates the last 20 commits starting at the baseline that touched the JIT sources (src/coreclr/jit/* and jiteeversionguid.h), to find candidate commits with a downloadable baseline JIT. A failure means git could not traverse the log, typically because the baseline_hash is invalid or unreachable.","triggerScenarios":"subprocess.Popen(['git','log','--pretty=format:%H', baseline_hash, '-20','--','src/coreclr/jit/*','src/coreclr/inc/jiteeversionguid.h']) returns nonzero. Occurs when baseline_hash is unknown to the repo (shallow clone, missing object), when the pathspec matches nothing due to a relocated source tree, or when baseline_hash is malformed.","commonSituations":"Shallow or partial clone missing the baseline commit; running on an old checkout where src/coreclr layout differs; a baseline_hash computed from a fork that isn't present locally; corrupted object database.","solutions":["Ensure baseline_hash is present: 'git -C <repo> cat-file -t <baseline_hash>' must report 'commit'.","Deepen the clone: 'git fetch --unshallow origin' or increase --depth.","Verify the src/coreclr/jit pathspec exists in the current checkout.","Pass --base_git_hash <sha> explicitly with a commit you know is reachable."],"exampleFix":"// before\ncommand = [\"git\", \"log\", \"--pretty=format:%H\", baseline_hash, \"-20\", \"--\", \"src/coreclr/jit/*\", \"src/coreclr/inc/jiteeversionguid.h\"]\nproc = subprocess.Popen(command, stdout=subprocess.PIPE)\nstdout_change_list, _ = proc.communicate()\nif proc.returncode != 0:\n    raise RuntimeError(\"Couldn't determine list of JIT changes starting with baseline hash\")\n// after (fix invocation)\ngit -C <repo> cat-file -t <baseline_hash>   # must print 'commit'\ngit -C <repo> fetch --unshallow origin\npython superpmi.py asmdiff --base_git_hash <known-good-sha> ...","handlingStrategy":"validation","validationCode":"import subprocess\ndef validate_jit_change_list(repo_location, baseline_hash):\n    cat = subprocess.run(['git', '-C', repo_location, 'cat-file', '-t', baseline_hash], capture_output=True)\n    if cat.returncode != 0:\n        raise RuntimeError(f\"baseline_hash not present: {baseline_hash}; deepen the clone.\")\n    cmd = ['git', '-C', repo_location, 'log', '--pretty=format:%H', baseline_hash, '-20', '--', 'src/coreclr/jit/*', 'src/coreclr/inc/jiteeversionguid.h']\n    proc = subprocess.run(cmd, capture_output=True)\n    if proc.returncode != 0:\n        raise RuntimeError(f\"git log failed: {proc.stderr.decode('utf-8','replace').strip()}\")\n    return proc.stdout.decode('utf-8').strip().splitlines()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure baseline_hash is a reachable commit (git cat-file -t).","Deepen shallow clones before baseline detection.","Verify src/coreclr/jit pathspec matches your checkout layout."],"tags":["git","base-jit","git-log","subprocess","superpmi","asmdiff"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}