dotnet/runtime · error · RuntimeError

Specified -base_jit_path does not point to a file

Error message

Specified -base_jit_path does not point to a file

What it means

Raised in the baseline-JIT resolver (superpmi.py:4844-4846) when `-base_jit_path` is supplied but does not point to an existing file. When the user explicitly provides a baseline clrjit, the script validates the path is a real file rather than searching/downloading a default baseline JIT.

Source

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

        5. Check if we've already downloaded a JIT that matches `base_git_hash`, and use that if available.
        6. Starting with `base_git_hash`, and possibly walking to older changes, look for matching builds
           in the JIT rolling build drops.
        7. If a baseline clrjit is found, download it to the `spmi/basejit/git-hash.os.architecture.build_type`
           cache directory.
        8. Set coreclr_args.base_jit_path to the full path to the downloaded baseline JIT.

    Args:
        coreclr_args (CoreclrArguments) : parsed args

    Returns:
        Nothing

        coreclr_args.base_jit_path is set to the path to the JIT to use for the baseline JIT.
    """

    if coreclr_args.base_jit_path is not None:
        if not os.path.isfile(coreclr_args.base_jit_path):
            raise RuntimeError("Specified -base_jit_path does not point to a file")
        coreclr_args.base_jit_path = os.path.abspath(coreclr_args.base_jit_path)
        return

    # We cache baseline jits under the following directory. Note that we can't create the full directory path
    # until we know the baseline JIT hash.
    default_basejit_root_dir = os.path.join(coreclr_args.spmi_location, "basejit")

    # Do all the remaining commands, including a number of 'git' commands including relative paths,
    # from the root of the runtime repo.

    with ChangeDir(coreclr_args.runtime_repo_location):
        if coreclr_args.git_hash is None:
            command = [ "git", "rev-parse", "HEAD" ]
            logging.debug("Invoking: %s", " ".join(command))
            proc = subprocess.Popen(command, stdout=subprocess.PIPE)
            stdout_git_rev_parse, _ = proc.communicate()
            return_code = proc.returncode
            if return_code == 0:

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Verify the path exists (`ls <path>`) and use an absolute path to the baseline clrjit.
  2. Drop `-base_jit_path` to let the script compute and download the baseline JIT from the rolling build by git hash.
  3. Rebuild the baseline runtime so the clrjit file exists at the expected location.

Example fix

// before
superpmi.py asmdiffs -base_jit_path ./old/clrjit.dll -mch_files foo.mch ...
// after
superpmi.py asmdiffs -base_jit_path /abs/path/to/base/artifacts/bin/coreclr/<os>.<arch>.Release/clrjit.dll -mch_files foo.mch ...
Defensive patterns

Strategy: validation

Validate before calling

import os
if args.base_jit_path is not None:
    p = os.path.abspath(args.base_jit_path)
    if not os.path.isfile(p):
        raise SystemExit(f'-base_jit_path {p} is not a file; omit it to auto-resolve a baseline clrjit')

Prevention

When it happens

Trigger: Passing `-base_jit_path <path>` to asmdiffs/tpdiff/metricdiff where the path is not a file. The os.path.isfile check fires before absolutizing the path and returning.

Common situations: Typo or stale path to a clrjit.dll from a removed build; relative path resolving under the wrong cwd; pointing at a directory or to a build product that wasn't emitted; arch/build mismatch so the file lives elsewhere.

Related errors


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