{"record":{"id":"d41ec2492b8484b6","repo":"dotnet/runtime","slug":"tiering-options-have-no-effect-for-nativeaot-colle","errorCode":null,"errorMessage":"Tiering options have no effect for nativeaot collections.","messagePattern":"Tiering options have no effect for nativeaot collections\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi.py","lineNumber":723,"sourceCode":"\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\n        self.base_mch_file = None\n\n        # Final .MCH file path\n        if self.coreclr_args.output_mch_path is not None:\n            self.final_mch_file = os.path.abspath(self.coreclr_args.output_mch_path)\n            final_mch_dir = os.path.dirname(self.final_mch_file)","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi.py#L705-L741","documentation":"Thrown by SuperPMICollect.__init__() when the user requests a nativeaot collection mode (--nativeaot) and simultaneously passes --tiered_compilation or --tiered_pgo. NativeAOT is an ahead-of-time compilation scenario where tiered compilation and PGO have no meaning — the JIT runs once at build time via the IL compiler (ilc), not through the tiered runtime path.","triggerScenarios":"At lines 719-723: if coreclr_args.nativeaot and (coreclr_args.tiered_compilation or coreclr_args.tiered_pgo), line 723 raises. The combination is rejected because nativeaot collections invoke ilc with .rsp files, not the runtime JIT with tiering.","commonSituations":"A developer runs 'superpmi.py collect --nativeaot -ilc_rsps foo.ilc.rsp --tiered_compilation' not realizing NativeAOT is AOT-only. Copying tiering flags from a JIT investigation workflow into a NativeAOT collection command.","solutions":["Remove --tiered_compilation and --tiered_pgo flags when using --nativeaot with superpmi.py collect.","If you need tiered compilation behavior, use the default collection mode (a runtime collection command) or --pmi instead of --nativeaot.","Understand that NativeAOT compiles everything ahead-of-time via ilc; there is no tier-0/tier-1 distinction."],"exampleFix":"# before: incompatible flags for nativeaot\npython superpmi.py collect --nativeaot -ilc_rsps mylib.ilc.rsp --tiered_compilation\n\n# after: remove tiering flags for nativeaot\npython superpmi.py collect --nativeaot -ilc_rsps mylib.ilc.rsp","handlingStrategy":"validation","validationCode":"# Validate argument compatibility before calling SuperPMICollect\nif coreclr_args.nativeaot:\n    if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:\n        raise ValueError('Tiering options (--tiered_compilation, --tiered_pgo) are incompatible with --nativeaot')","typeGuard":"def is_valid_nativeaot_tiering_combo(nativeaot: bool, tiered_compilation: bool, tiered_pgo: bool) -> bool:\n    if nativeaot:\n        return not (tiered_compilation or tiered_pgo)\n    return True","tryCatchPattern":"try:\n    collector = SuperPMICollect(coreclr_args)\nexcept RuntimeError as e:\n    if 'Tiering options have no effect for nativeaot' in str(e):\n        logging.error('Remove --tiered_compilation and --tiered_pgo when using --nativeaot')\n        sys.exit(1)\n    raise","preventionTips":["Never combine --tiered_compilation or --tiered_pgo with --nativeaot.","Understand that NativeAOT is ahead-of-time compilation with no runtime tiering.","If tiering investigation is needed, use the default collection command mode or --pmi instead of --nativeaot."],"tags":["superpmi","validation","tiering","nativeaot","collect"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}