{"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/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L4892-L4928","documentation":"Raised by get_baseline_jit when `git log --pretty=format:%H <baseline> -20 -- src/coreclr/jit/* src/coreclr/inc/jiteeversionguid.h` exits non-zero. The script enumerates the last 20 JIT/GUID-affecting commits to search for a downloadable baseline JIT.","triggerScenarios":"baseline_hash does not name a valid commit reachable in the local object store, or the pathspec paths are invalid (e.g., repo layout changed).","commonSituations":"baseline_hash from merge-base points at a missing object in a shallow clone; the runtime layout was restructured so src/coreclr/jit no longer matches; corrupted/packed refs.","solutions":["Confirm the baseline object is present: `git cat-file -t <baseline_hash>`; if missing, fetch it.","Run the same `git log` command by hand to see the real git error.","Pass `--base_git_hash <commit>` so the change-list enumeration is skipped entirely.","Refresh refs with `git fetch --all`."],"exampleFix":"// before\n# baseline_hash object not present -> raises [183]\n// after\ngit fetch origin <baseline_hash> && python superpmi.py ...\n# or\npython superpmi.py --base_git_hash <commit> ...","handlingStrategy":"validation","validationCode":"import subprocess\nrc = subprocess.run(['git','cat-file','-t',baseline_hash], cwd=runtime_repo_location).returncode\nif rc != 0:\n    raise SystemExit(f'baseline {baseline_hash} not present; fetch it or pass --base_git_hash')\nrc = subprocess.run(['git','log','--pretty=format:%H',baseline_hash,'-20','--','src/coreclr/jit/*'], cwd=runtime_repo_location).returncode\nif rc != 0:\n    raise SystemExit('git log over jit pathspec failed')","typeGuard":"def baseline_log_ok(baseline: str, cwd: str) -> bool:\n    import subprocess\n    return subprocess.run(['git','log','--pretty=format:%H',baseline,'-20','--','src/coreclr/jit/*'],\n                          cwd=cwd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0","tryCatchPattern":"try:\n    main(...)\nexcept RuntimeError as e:\n    if 'list of JIT changes' in str(e):\n        subprocess.run(['git','fetch','--all'], cwd=runtime_repo_location, check=False)\n        main(...)","preventionTips":["Confirm baseline object exists with git cat-file -t","Keep jit pathspec valid after repo restructures","Use --base_git_hash to bypass enumeration"],"tags":["git","superpmi","shallow-clone"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}