dotnet/runtime · error · RuntimeError

Couldn't determine list of JIT changes starting with baselin

Error message

Couldn't determine list of JIT changes starting with baseline hash

What it means

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.

Source

Thrown at src/coreclr/scripts/superpmi.py:4910

                raise RuntimeError("Couldn't determine baseline git hash")

            baseline_hash = stdout_git_merge_base.decode('utf-8').strip()
            logging.info("Baseline hash: %s", baseline_hash)
        else:
            baseline_hash = coreclr_args.base_git_hash

        if coreclr_args.base_git_hash is None:
            # Enumerate the last 20 changes, starting with the baseline, that included JIT and JIT-EE GUID changes.
            command = [ "git", "log", "--pretty=format:%H", baseline_hash, "-20", "--", "src/coreclr/jit/*", "src/coreclr/inc/jiteeversionguid.h" ]
            logging.debug("Invoking: %s", " ".join(command))
            proc = subprocess.Popen(command, stdout=subprocess.PIPE)
            stdout_change_list, _ = proc.communicate()
            return_code = proc.returncode
            change_list_hashes = []
            if return_code == 0:
                change_list_hashes = stdout_change_list.decode('utf-8').strip().splitlines()
            else:
                raise RuntimeError("Couldn't determine list of JIT changes starting with baseline hash")

            if len(change_list_hashes) == 0:
                raise RuntimeError("No JIT changes found starting with baseline hash")
        else:
            # If `-base_git_hash` is specified, then we use exactly that hash and no other for the baseline.
            change_list_hashes = [ coreclr_args.base_git_hash ]

        # 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.

        hashnum = 1
        for git_hash in change_list_hashes:
            logging.debug("%s: %s", hashnum, git_hash)

            jit_name = get_jit_name(coreclr_args)
            basejit_dir = os.path.join(default_basejit_root_dir, "{}.{}.{}.{}".format(git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type))
            basejit_path = os.path.join(basejit_dir, jit_name)
            if os.path.isfile(basejit_path):
                # We found this baseline JIT in our cache; use it!

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Confirm the baseline object is present: `git cat-file -t <baseline_hash>`; if missing, fetch it.
  2. Run the same `git log` command by hand to see the real git error.
  3. Pass `--base_git_hash <commit>` so the change-list enumeration is skipped entirely.
  4. Refresh refs with `git fetch --all`.

Example fix

// before
# baseline_hash object not present -> raises [183]
// after
git fetch origin <baseline_hash> && python superpmi.py ...
# or
python superpmi.py --base_git_hash <commit> ...
Defensive patterns

Strategy: validation

Validate before calling

import subprocess
rc = subprocess.run(['git','cat-file','-t',baseline_hash], cwd=runtime_repo_location).returncode
if rc != 0:
    raise SystemExit(f'baseline {baseline_hash} not present; fetch it or pass --base_git_hash')
rc = subprocess.run(['git','log','--pretty=format:%H',baseline_hash,'-20','--','src/coreclr/jit/*'], cwd=runtime_repo_location).returncode
if rc != 0:
    raise SystemExit('git log over jit pathspec failed')

Type guard

def baseline_log_ok(baseline: str, cwd: str) -> bool:
    import subprocess
    return subprocess.run(['git','log','--pretty=format:%H',baseline,'-20','--','src/coreclr/jit/*'],
                          cwd=cwd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0

Try / catch

try:
    main(...)
except RuntimeError as e:
    if 'list of JIT changes' in str(e):
        subprocess.run(['git','fetch','--all'], cwd=runtime_repo_location, check=False)
        main(...)

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06). Data as JSON: /api/errors/f027f78561161437. Report an issue: GitHub.