rust-lang/rust · critical · Exception

Invalid input data path: '{path}'\nIf test data has not been

Error message

Invalid input data path: '{path}'\nIf test data has not been generated for this test yet, consider using the `--bless` option.

What it means

Raised by lldb_batchmode's TargetData.initialize when the env var LLDB_BATCHMODE_INPUT_DATA_PATH points at a path that is not a regular file, in non-bless mode. The harness needs pre-generated reference JSON to compare LLDB output against; without it the test cannot run. The message itself suggests re-running with --bless to generate the data.

Source

Thrown at src/etc/lldb_batchmode/common.py:468

    A map of type names to types. Contains all types present in the test's variables, including the
    types of fields and child objects.
    """

    # If we ever decide that it makes sense to check the same variable twice at the same breakpoint
    # this will need to be converted to a list
    breakpoints: list[dict[str, Variable]] = field(default_factory=list)
    """Each element corresponds to one stopping point in the test. The element itself is a
    dictionary mapping variable names to their respective test data."""

    @staticmethod
    def initialize() -> "TargetData":
        result = TargetData()
        path = os.environ["LLDB_BATCHMODE_INPUT_DATA_PATH"]
        if not os.path.isfile(path):
            if BLESS:
                return result
            else:
                raise Exception(
                    f"Invalid input data path: '{path}'\nIf test data has not been \
generated for this test yet, consider using the `--bless` option."
                )

        if BLESS:
            return result

        with open(path, "r") as f:
            try:
                result = from_dict(TargetData, json.load(f))
            except json.decoder.JSONDecodeError:
                print("Warning: Malformed input data, reverting to default")

        return result

    def save_blessing(self, metadata: BlessMetadata):
        """Writes the entirety of `self` to the env var `LLDB_BATCHMODE_INPUT_DATA_PATH`, which is
        set by `compiletest` before running `lldb_batchmode. Used to finalize changes made by one or

View on GitHub (pinned to 7088e4b63a)

Solutions

  1. Run the test with the --bless (update-references / bless) flag so TargetData.initialize returns empty and from_lldb writes reference data.
  2. Verify LLDB_BATCHMODE_INPUT_DATA_PATH is set by compiletest and points at a real, readable JSON file.
  3. Re-run compiletest normally after blessing to confirm the path now resolves.

Example fix

# before (no blessed data, test fails to start)
compiletest --suite debuginfo-lldb
# after
compiletest --suite debuginfo-lldb --bless
Defensive patterns

Strategy: validation

Validate before calling

import os
path = os.environ.get("LLDB_BATCHMODE_INPUT_DATA_PATH")
if not path or not os.path.isfile(path):
    raise SystemExit(
        "LLDB_BATCHMODE_INPUT_DATA_PATH missing or invalid; "
        "run with --bless to generate reference data first"
    )

Try / catch

try:
    data = TargetData.initialize()
except Exception as e:
    if "Invalid input data path" in str(e):
        print("Re-run the suite with --bless to generate LLDB reference data")
        raise SystemExit(2)
    raise

Prevention

When it happens

Trigger: Running a debuginfo (lldb) test via compiletest without having blessed it first: the path is unset, points at a stale/missing location, or the file was deleted. The os.path.isfile(path) check at line 464 returns False and BLESS is False, so the exception fires.

Common situations: Fresh checkout without blessed lldb test data; the test's output directory was cleaned; the env var was overridden by a wrapper script to an incorrect path.

Related errors


AI-assisted analysis of rust-lang/rust@7088e4b63a (2026-08-10). Data as JSON: /api/errors/41d7ba95dd793c1e. Report an issue: GitHub.