{"record":{"id":"333ff11c76c43da1","repo":"dotnet/runtime","slug":"unable-to-find-input-file-in-original-rsp-filepat","errorCode":null,"errorMessage":"Unable to find input file in {original_rsp_filepath}","messagePattern":"Unable to find input file in (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":1209,"sourceCode":"                    # The contents of the rsp contain many knobs and arguments that represent customer scenarios.\n                    # Make a copy of the .ilc.rsp file as we are going to modify it. We do not want to modify the original one.\n                    # The modifications include re-writing paths for references, input assembly and the output.\n                    # We do this because the current paths in the rsp *may* not exist by the time we want to run ilc.\n                    rsp_filepath = os.path.join(self.temp_location, make_safe_filename(\"nativeaot_\" + original_rsp_filepath) + \".rsp\")\n                    shutil.copyfile(original_rsp_filepath, rsp_filepath)\n\n                    rsp_file = open(rsp_filepath, \"r\")\n                    rsp_contents = rsp_file.readlines()\n                    rsp_file.close()\n\n                    original_input_filepath = \"\"\n\n                    for line in rsp_contents:\n                        if not line.startswith(\"-\"):\n                            original_input_filepath = line\n\n                    if original_input_filepath == \"\":\n                        raise RuntimeError(f\"Unable to find input file in {original_rsp_filepath}\")\n\n                    input_filename = os.path.basename(original_input_filepath)\n\n                    # The ilc.rsp files are stored in the 'native' folders, ex: 'ComWrappers/ComWrappers/native/ComWrappers.ilc.rsp'\n                    test_native_directory = os.path.abspath(os.path.join(original_rsp_filepath, \"..\")) # ex: 'ComWrappers/ComWrappers/native/'\n                    test_output_directory = os.path.join(test_native_directory, \"..\") # ex: 'ComWrappers/ComWrappers/'\n                    test_directory = os.path.join(test_output_directory, \"..\") # ex: 'ComWrappers/'\n\n                    # The corresponding input assemblies are in the folder above 'native', ex: 'ComWrappers/ComWrappers/'\n                    test_input_filepath = os.path.join(test_output_directory, input_filename)\n\n                    # Blow away references, output, input assembly and directpinvokelist as we are going to use new ones.\n                    rsp_file = open(rsp_filepath, \"w\")\n                    def filter_rsp_argument(line):\n                        if line.startswith(\"-r:\") or line.startswith(\"-o:\") or not line.startswith(\"-\") or line.startswith(\"--directpinvokelist:\"):\n                            return False\n                        else:\n                            return True","sourceCodeStart":1191,"sourceCodeEnd":1227,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L1191-L1227","documentation":"Raised inside run_nativeaot() in superpmi.py when scanning the ilc.rsp lines yields no input assembly. The loop sets original_input_filepath to the first line not starting with '-'; if none is found (every line is a flag/option), the rsp has no input file and the script cannot proceed.","triggerScenarios":"An ilc.rsp whose lines all begin with '-' (no bare input assembly path), or an empty/malformed rsp where the input assembly line was stripped or never written.","commonSituations":"Manually edited rsp missing the input assembly; upstream nativeaot build step that generated an incomplete rsp; whitespace/encoding making the input line start with '-' or be skipped.","solutions":["Open the rsp and confirm there is exactly one line that is a bare path to the input assembly (not prefixed with '-').","Regenerate the ilc.rsp via the nativeaot build/test infrastructure rather than hand-editing.","If the input path legitimately starts with '-', escape or rewrite it per ilc conventions."],"exampleFix":"// before  (rsp contains only flags, no input line)\npython superpmi.py collect --nativeaot -ilc_rsps broken.ilc.rsp   # 'Unable to find input file in broken.ilc.rsp'\n// after  (ensure rsp has a bare input assembly line, e.g.)\n//   --opt:foo\n//   ComWrappers.dll\npython superpmi.py collect --nativeaot -ilc_rsps fixed.ilc.rsp","handlingStrategy":"validation","validationCode":"with open(rsp_path, encoding=\"utf-8\") as fh:\n    lines = fh.read().splitlines()\ninputs = [ln for ln in lines if ln.strip() and not ln.lstrip().startswith(\"-\")]\nif not inputs:\n    raise SystemExit(f\"No input assembly line found in {rsp_path}; rsp is malformed\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat ilc.rsp as build-generated artifacts; avoid hand-editing.","Add a CI lint that every ilc.rsp contains exactly one bare input path."],"tags":["superpmi","collect","nativeaot","file-parsing","argument-validation","python"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}