{"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/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/jitrollingbuild.py#L203-L239","documentation":"Thrown by process_git_hash_arg() when 'git log --pretty=format:%H baseline_hash -20 -- src/coreclr/jit/* src/coreclr/inc/jiteeversionguid.h' returns a non-zero exit code. This git log command enumerates the last 20 commits from the baseline that touched JIT source files or the JIT-EE version GUID header, which are used to probe the rolling build store for a matching pre-built JIT.","triggerScenarios":"Called after successfully computing baseline_hash. The script runs git log to list commit hashes that modified src/coreclr/jit/* or src/coreclr/inc/jiteeversionguid.h. If the command fails (return_code != 0), the RuntimeError is raised at line 221.","commonSituations":"The baseline_hash references a commit that does not exist locally (e.g., it was garbage-collected, or the clone is shallow and the baseline is outside the shallow boundary). A gitindex or filesystem corruption prevents reading the jit directory history. The pathspec 'src/coreclr/jit/*' doesn't match because the repo structure has changed.","solutions":["Run the git log command manually to see the exact error: 'git log --pretty=format:%H <baseline_hash> -20 -- src/coreclr/jit/* src/coreclr/inc/jiteeversionguid.h'.","If the baseline_hash is from a shallow clone boundary, deepen with 'git fetch --unshallow' or 'git fetch --deepen=100'.","Verify that src/coreclr/jit/ exists in the baseline commit's tree.","Pass -git_hash explicitly to skip the auto-detection logic."],"exampleFix":"# before: shallow clone, baseline hash unreachable\npython jitrollingbuild.py download\n\n# after: deepen clone history\ngit fetch --deepen=200\npython jitrollingbuild.py download","handlingStrategy":"validation","validationCode":"# Verify git log can find JIT changes from the baseline\nimport subprocess\nbaseline = subprocess.run(['git', 'merge-base', 'HEAD', 'origin/main'], capture_output=True, cwd=repo_path).stdout.decode().strip()\nresult = subprocess.run(['git', 'log', '--pretty=format:%H', baseline, '-20', '--', 'src/coreclr/jit/*', 'src/coreclr/inc/jiteeversionguid.h'], capture_output=True, cwd=repo_path)\nif result.returncode != 0:\n    print('git log for JIT changes failed. Check repo state or pass -git_hash.')","typeGuard":"def jit_history_accessible(repo_path: str, baseline_hash: str) -> bool:\n    result = subprocess.run(['git', 'log', '--pretty=format:%H', baseline_hash, '-1', '--', 'src/coreclr/jit/'], capture_output=True, cwd=repo_path)\n    return result.returncode == 0","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('git log for JIT sources failed. Verify src/coreclr/jit/ exists in history.')\n        sys.exit(1)\n    raise","preventionTips":["Ensure the repo has complete history (not shallow) for src/coreclr/jit/.","Verify the repo layout matches dotnet/runtime (src/coreclr/jit/ must exist).","Pass -git_hash to skip the git log enumeration."],"tags":["git","jitrollingbuild","infrastructure","shallow-clone","git-log"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}