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

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.

Source

Thrown at src/coreclr/scripts/jitrollingbuild.py:221

        stdout_git_merge_base, _ = proc.communicate()
        return_code = proc.returncode
        if return_code != 0:
            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)

        # 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: {}".format(" ".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")

        # For each hash, see if the rolling build contains the JIT.

        hashnum = 1
        for git_hash in change_list_hashes:
            logging.info("try {}: {}".format(hashnum, git_hash))

            # Set the git hash to look for
            # Note: there's a slight inefficiency here because this code searches for a JIT at this hash value, and
            # then when we go to download, we do the same search again because we don't cache the result and pass it
            # directly on to the downloader.
            coreclr_args.git_hash = git_hash

            if return_first_hash:
                # Just use the first one

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. 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'.
  2. If the baseline_hash is from a shallow clone boundary, deepen with 'git fetch --unshallow' or 'git fetch --deepen=100'.
  3. Verify that src/coreclr/jit/ exists in the baseline commit's tree.
  4. Pass -git_hash explicitly to skip the auto-detection logic.

Example fix

# before: shallow clone, baseline hash unreachable
python jitrollingbuild.py download

# after: deepen clone history
git fetch --deepen=200
python jitrollingbuild.py download
Defensive patterns

Strategy: validation

Validate before calling

# Verify git log can find JIT changes from the baseline
import subprocess
baseline = subprocess.run(['git', 'merge-base', 'HEAD', 'origin/main'], capture_output=True, cwd=repo_path).stdout.decode().strip()
result = subprocess.run(['git', 'log', '--pretty=format:%H', baseline, '-20', '--', 'src/coreclr/jit/*', 'src/coreclr/inc/jiteeversionguid.h'], capture_output=True, cwd=repo_path)
if result.returncode != 0:
    print('git log for JIT changes failed. Check repo state or pass -git_hash.')

Type guard

def jit_history_accessible(repo_path: str, baseline_hash: str) -> bool:
    result = subprocess.run(['git', 'log', '--pretty=format:%H', baseline_hash, '-1', '--', 'src/coreclr/jit/'], capture_output=True, cwd=repo_path)
    return result.returncode == 0

Try / catch

try:
    process_git_hash_arg(coreclr_args)
except RuntimeError as e:
    if 'list of JIT changes' in str(e):
        logging.error('git log for JIT sources failed. Verify src/coreclr/jit/ exists in history.')
        sys.exit(1)
    raise

Prevention

When it happens

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

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

Related errors


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