dotnet/runtime · error · RuntimeError

Tiering options have no effect for nativeaot collections.

Error message

Tiering options have no effect for nativeaot collections.

What it means

Raised by SuperPMICollect.__init__ in superpmi.py when --nativeaot is combined with --tiered_compilation or --tiered_pgo. NativeAOT is full ahead-of-time compilation, so tiered compilation and tiered PGO do not apply; the combination is rejected.

Solutions

  1. Remove --tiered_compilation / --tiered_pgo from the nativeaot collection invocation.
  2. Pass nativeaot-specific codegen options via the rsp/--codegenopt mechanism instead of tiering flags.

Example fix

// before
python superpmi.py collect --nativeaot -ilc_rsps foo.ilc.rsp --tiered_pgo   # 'Tiering options have no effect for nativeaot collections.'
// after
python superpmi.py collect --nativeaot -ilc_rsps foo.ilc.rsp
Defensive patterns

Strategy: validation

Validate before calling

if args.nativeaot and (args.tiered_compilation or args.tiered_pgo):
    raise SystemExit("--nativeaot cannot be combined with --tiered_compilation/--tiered_pgo")

Prevention

When it happens

Trigger: Invoking `superpmi.py collect --nativeaot -ilc_rsps <files> --tiered_compilation ...` (or --tiered_pgo).

Common situations: Reusing a tiered-collect command line with --nativeaot added; assuming tiering knobs apply to AOT.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/d41ec2492b8484b6. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/superpmi.py:723

        if coreclr_args.pmi:
            self.pmi_location = determine_pmi_location(coreclr_args)
            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)

        if coreclr_args.crossgen2:
            self.corerun = os.path.join(self.core_root, self.corerun_tool_name)

        if coreclr_args.pmi or coreclr_args.crossgen2:
            self.assemblies = coreclr_args.assemblies
            self.exclude = coreclr_args.exclude
            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:
               raise RuntimeError("Tiering options have no effect for pmi or crossgen2 collections.")

        if coreclr_args.nativeaot:
            self.ilc_rsps = coreclr_args.ilc_rsps
            self.exclude = coreclr_args.exclude
            if coreclr_args.tiered_compilation or coreclr_args.tiered_pgo:
                raise RuntimeError("Tiering options have no effect for nativeaot collections.")

        if coreclr_args.tiered_compilation and coreclr_args.tiered_pgo:
            raise RuntimeError("Pass only one tiering option.")

        self.coreclr_args = coreclr_args

        self.temp_location = None

        # Pathname for a temporary .MCL file used for noticing SuperPMI replay failures against base MCH.
        self.base_fail_mcl_file = None

        # The base .MCH file path
        self.base_mch_file = None

        # Final .MCH file path
        if self.coreclr_args.output_mch_path is not None:
            self.final_mch_file = os.path.abspath(self.coreclr_args.output_mch_path)
            final_mch_dir = os.path.dirname(self.final_mch_file)

View on GitHub (pinned to 60108ba66e)