{"record":{"id":"5a5dad931a4ea145","repo":"dotnet/runtime","slug":"couldn-t-determine-list-of-jit-changes-starting-wi","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/jitrollingbuild.py","lineNumber":221,"sourceCode":"        stdout_git_merge_base, _ = proc.communicate()\n        return_code = proc.returncode\n        if return_code != 0:\n            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\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: {}\".format(\" \".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\n        # For each hash, see if the rolling build contains the JIT.\n\n        hashnum = 1\n        for git_hash in change_list_hashes:\n            logging.info(\"try {}: {}\".format(hashnum, git_hash))\n\n            # Set the git hash to look for\n            # Note: there's a slight inefficiency here because this code searches for a JIT at this hash value, and\n            # then when we go to download, we do the same search again because we don't cache the result and pass it\n            # directly on to the downloader.\n            coreclr_args.git_hash = git_hash\n\n            if return_first_hash:\n                # Just use the first one","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/jitrollingbuild.py#L203-L239","documentation":"Raised by process_git_hash_arg() in jitrollingbuild.py when 'git log --pretty=format:%H <baseline_hash> -20 -- src/coreclr/jit/* src/coreclr/inc/jiteeversionguid.h' fails. This command enumerates the last 20 commits starting from the baseline that touched JIT source files or the JIT-EE interface GUID header. These commits are candidates for finding a matching rolling build.","triggerScenarios":"Triggered when the git log command returns non-zero. This can happen if baseline_hash is not a valid commit, if the paths specified don't exist in the baseline commit (though git log typically still returns 0 in that case, just with no output), or if the repository's object database is corrupted.","commonSituations":"The baseline_hash computed from merge-base is stale or invalid (e.g., from a garbage-collected commit in a shallow clone). The src/coreclr/jit/ or src/coreclr/inc/jiteeversionguid.h paths don't exist at the baseline commit (repo restructuring). Git internal corruption.","solutions":["Verify baseline_hash is valid: run 'git cat-file -t <baseline_hash>'.","Run the git log command manually to see the actual error output.","If using a shallow clone, deepen it with 'git fetch --unshallow' or 'git fetch --deepen=N'.","Check that the repository structure at the baseline commit contains the expected paths.","Pass -git_hash to skip auto-detection."],"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()\nreturn_code = proc.returncode\nif return_code == 0:\n    change_list_hashes = stdout_change_list.decode('utf-8').strip().splitlines()\nelse:\n    raise RuntimeError(\"Couldn't determine list of JIT changes starting with baseline hash\")\n\n# after - capture stderr and check path existence\ncommand = [\"git\", \"log\", \"--pretty=format:%H\", baseline_hash, \"-20\", \"--\", \"src/coreclr/jit/*\", \"src/coreclr/inc/jiteeversionguid.h\"]\nproc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\nstdout_change_list, stderr = proc.communicate()\nreturn_code = proc.returncode\nif return_code == 0:\n    change_list_hashes = stdout_change_list.decode('utf-8').strip().splitlines()\nelse:\n    raise RuntimeError(\n        \"Couldn't determine list of JIT changes starting with baseline hash {}: {}\".format(\n            baseline_hash, stderr.decode('utf-8').strip()))","handlingStrategy":"validation","validationCode":"import subprocess, os\n\ndef can_enumerate_jit_changes(repo_path: str, baseline_hash: str) -> bool:\n    \"\"\"Check if git log can enumerate JIT changes from the baseline.\"\"\"\n    jit_paths = ['src/coreclr/jit/*', 'src/coreclr/inc/jiteeversionguid.h']\n    # Verify paths exist at baseline\n    result = subprocess.run(\n        ['git', 'log', '--pretty=format:%H', baseline_hash, '-1', '--'] + jit_paths,\n        cwd=repo_path, capture_output=True)\n    return result.returncode == 0","typeGuard":"null","tryCatchPattern":"try:\n    process_git_hash_arg(coreclr_args)\nexcept RuntimeError as e:\n    if \"list of JIT changes\" in str(e):\n        logging.error(f\"{e}. Verify baseline_hash is valid and JIT paths exist.\")\n        logging.error(f\"Run manually: git log --oneline {baseline_hash} -20 -- src/coreclr/jit/\")\n    raise","preventionTips":["Ensure the baseline commit is reachable (not garbage-collected) in the repo.","Verify the JIT source paths exist at the baseline commit.","Avoid shallow clones that may not have the baseline commit.","Pass -git_hash to skip the entire auto-detection chain."],"tags":["git","jit","rolling-build","coreclr","superpmi"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}