dotnet/runtime · error · RuntimeError

Error

Error message

Error

What it means

Thrown by setup_args() in the upload mode branch when coreclr_args.product_location does not exist as a directory. Before uploading a JIT, the script verifies that the build output directory (where clrjit.dll/libclrjit.so is expected) is valid; a missing product_location means no build artifacts can be found.

Source

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

        coreclr_args.verify(args,
                            "git_hash",
                            lambda unused: True,
                            "Unable to set git_hash")

        coreclr_args.verify(args,
                            "use_latest_jit_change",
                            lambda unused: True,
                            "Unable to set use_latest_jit_change")

        coreclr_args.verify(args,
                            "skip_cleanup",
                            lambda unused: True,
                            "Unable to set skip_cleanup")

        if not os.path.isdir(coreclr_args.product_location):
            logging.error("Built product location could not be determined")
            raise RuntimeError("Error")

    elif coreclr_args.mode == "download":

        coreclr_args.verify(args,
                            "git_hash",
                            lambda unused: True,
                            "Unable to set git_hash")

        coreclr_args.verify(args,
                            "target_dir",
                            lambda unused: True,
                            "Unable to set target_dir")

        coreclr_args.verify(args,
                            "skip_cleanup",
                            lambda unused: True,
                            "Unable to set skip_cleanup")

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Build the runtime first (e.g., using 'build.sh' or the appropriate build script) before running upload.
  2. Verify the product_location path: check os.path.isdir() for the path shown in logs.
  3. Pass -product_location explicitly pointing to the directory containing the built clrjit binary.
  4. Ensure -arch, -build_type, and -host_os match the build configuration you used.

Example fix

# before: no build exists yet
python jitrollingbuild.py upload -git_hash abc123

# after: build first, then upload
./build.sh clr.runtime+libs -c Checked -a x64
python jitrollingbuild.py upload -git_hash abc123
Defensive patterns

Strategy: validation

Validate before calling

# Verify product_location exists before calling upload
import os
if coreclr_args.mode == 'upload':
    if not os.path.isdir(coreclr_args.product_location):
        raise ValueError(f'Product location does not exist: {coreclr_args.product_location}. Build the runtime first.')

Type guard

def product_location_valid(path: str) -> bool:
    return os.path.isdir(path)

Try / catch

try:
    coreclr_args = setup_args(args)
except RuntimeError as e:
    if str(e) == 'Error' and coreclr_args.mode == 'upload':
        logging.error('Product location not found. Build the runtime or pass -product_location.')
        sys.exit(1)
    raise

Prevention

When it happens

Trigger: In setup_args() at lines 634-636: if coreclr_args.mode == 'upload' and not os.path.isdir(coreclr_args.product_location), the RuntimeError is raised. product_location is typically deduced from the repo root and build configuration or passed via -product_location.

Common situations: The .NET runtime build has not been run yet, so the product output directory doesn't exist. The -core_root or build output path was set incorrectly. The build was done for a different architecture/build_type than what CoreclrArguments computed. Running upload on a fresh checkout without building first.

Related errors


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