{"record":{"id":"f1359c493218d4de","repo":"dotnet/runtime","slug":"tiering-options-have-no-effect-for-pmi-or-crossgen","errorCode":null,"errorMessage":"Tiering options have no effect for pmi or crossgen2 collections.","messagePattern":"Tiering options have no effect for pmi or crossgen2 collections\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":717,"sourceCode":"\n        self.superpmi_path = determine_superpmi_tool_path(coreclr_args)\n        self.mcs_path = determine_mcs_tool_path(coreclr_args)\n\n        self.collection_command = coreclr_args.collection_command\n        self.collection_args = coreclr_args.collection_args\n\n        if coreclr_args.pmi:\n            self.pmi_location = determine_pmi_location(coreclr_args)\n            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)\n\n        if coreclr_args.crossgen2:\n            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)\n\n        if coreclr_args.pmi or coreclr_args.crossgen2:\n            self.assemblies = coreclr_args.assemblies\n            self.exclude = coreclr_args.exclude\n            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:\n               raise RuntimeError(\"Tiering options have no effect for pmi or crossgen2 collections.\")\n\n        if coreclr_args.nativeaot:\n            self.ilc_rsps = coreclr_args.ilc_rsps\n            self.exclude = coreclr_args.exclude\n            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:\n                raise RuntimeError(\"Tiering options have no effect for nativeaot collections.\")\n\n        if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:\n            raise RuntimeError(\"Pass only one tiering option.\")\n\n        self.coreclr_args = coreclr_args\n\n        self.temp_location = None\n\n        # Pathname for a temporary .MCL file used for noticing SuperPMI replay failures against base MCH.\n        self.base_fail_mcl_file = None\n\n        # The base .MCH file path","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/superpmi.py#L699-L735","documentation":"Raised by SuperPMICollect.__init__ in superpmi.py when (--pmi or --crossgen2) is combined with (--tiered_compilation or --tiered_pgo). PMI and crossgen2 perform single-shot compilation, so tiered compilation / tiered PGO do not apply; the script rejects the combination outright.","triggerScenarios":"Invoking `superpmi.py collect --pmi --tiered_compilation ...` or `... --crossgen2 --tiered_pgo ...`.","commonSituations":"Copy-pasting a tiered collection invocation and adding --pmi/--crossgen2; misunderstanding that PMI/crossgen2 are ahead-of-time style single compilations where tiering is meaningless.","solutions":["Remove the tiering flags (--tiered_compilation / --tiered_pgo) when using --pmi or --crossgen2.","If you need tiered behavior, collect via the command-based path (collection_command) instead of --pmi/--crossgen2."],"exampleFix":"// before\npython superpmi.py collect --pmi -assemblies <dir> --tiered_pgo   # 'Tiering options have no effect for pmi or crossgen2 collections.'\n// after\npython superpmi.py collect --pmi -assemblies <dir>","handlingStrategy":"validation","validationCode":"if (args.pmi or args.crossgen2) and (args.tiered_compilation or args.tiered_pgo):\n    raise SystemExit(\"--pmi/--crossgen2 cannot be combined with --tiered_compilation/--tiered_pgo\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember PMI/crossgen2 do single compilations; tiering is irrelevant.","Validate flag combinations in your wrapper before invoking collect."],"tags":["superpmi","collect","pmi","crossgen2","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"}