{"record":{"id":"0c880c2771598baf","repo":"dotnet/runtime","slug":"no-mc-files-generated","errorCode":null,"errorMessage":"No .mc files generated.","messagePattern":"No \\.mc files generated\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":1350,"sourceCode":"\n                # Set environment variables.\n                nativeaot_command_env = env_copy.copy()\n                set_and_report_env(nativeaot_command_env, root_env)\n\n                old_env = os.environ.copy()\n                os.environ.update(nativeaot_command_env)\n\n                ilc_rsps = list(filter(lambda ilc_rsp: ilc_rsp.endswith(\".ilc.rsp\"), ilc_rsps))\n                helper = AsyncSubprocessHelper(ilc_rsps, verbose=True)\n                helper.run_to_completion(run_nativeaot, self)\n\n                os.environ.clear()\n                os.environ.update(old_env)\n            ################################################################################################ end of \"self.coreclr_args.nativeaot is True\"\n\n        mc_files = [os.path.join(self.temp_location, item) for item in os.listdir(self.temp_location) if item.endswith(\".mc\")]\n        if len(mc_files) == 0:\n            raise RuntimeError(\"No .mc files generated.\")\n\n    def __merge_mc_files__(self):\n        \"\"\" Merge the mc files that were generated\n\n        Notes:\n            mcs -merge <s_baseMchFile> <s_tempDir>\\\\*.mc -recursive -dedup -thin\n\n        \"\"\"\n\n        logging.info(\"Merging MC files\")\n\n        pattern = os.path.join(self.temp_location, \"*.mc\")\n\n        command = [self.mcs_path, \"-merge\", self.base_mch_file, pattern, \"-recursive\", \"-dedup\", \"-thin\"]\n        run_and_log(command)\n\n        if not os.path.isfile(self.base_mch_file):\n            raise RuntimeError(\"MCH file failed to be generated at: %s\" % self.base_mch_file)","sourceCodeStart":1332,"sourceCodeEnd":1368,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L1332-L1368","documentation":"Raised by SuperPMICollect.__collect_mc_files__ in superpmi.py at the end of collection. It lists '*.mc' files in temp_location; if zero were produced, the collection produced no method contexts and the merge step would have nothing to work on, so it aborts.","triggerScenarios":"The collection command / PMI / crossgen2 / nativeaot run completed but the SuperPMI shim wrote no .mc files into the temp directory — e.g. the shim was not loaded (SuperPMIShimPath wrong), the target assemblies had no methods, or every collection invocation failed.","commonSituations":"Wrong SuperPMIShimPath or shim JIT missing from Core_Root; collection_command failed silently; -assemblies pointed at an empty/excluded directory; DOTNET_TieredCompilation/ReadyToRun settings prevented JIT compilation; disk/permission issue in temp_location.","solutions":["Re-run collection with -log_level debug and inspect why no .mc files appear (check the shim path and per-assembly exit codes).","Verify Core_Root contains the SuperPMI collector shim (superpmi-shim-collector.*) and the shim JIT, and that -core_root is correct.","Confirm -assemblies/-ilc_rsps actually resolve to compilable inputs and none are entirely excluded by -exclude.","For R2R images, add --disable_r2r so methods get JIT-compiled and collected."],"exampleFix":"// before\npython superpmi.py collect --pmi -assemblies bin/   # 'No .mc files generated.'\n// after\npython superpmi.py collect --pmi -assemblies bin/ --disable_r2r -log_level debug --core_root <valid Core_Root>","handlingStrategy":"validation","validationCode":"import os, glob\nmc_files = glob.glob(os.path.join(temp_location, \"*.mc\"))\nif not mc_files:\n    raise SystemExit(\"Collection produced no .mc files; verify the SuperPMI shim/JIT path and inputs\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run collection with -log_level debug until it succeeds at least once.","Verify Core_Root has the collector shim and shim JIT, and that inputs are real compilable assemblies."],"tags":["superpmi","collect","collection","shim","python"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}