dotnet/runtime · error · RuntimeError

Collection 'smoke_tests' is only available for 'nativeaot'…

Error message

Collection 'smoke_tests' is only available for 'nativeaot' collections.

What it means

Raised by superpmi_collect_setup.py at src/coreclr/scripts/superpmi_collect_setup.py:654 when collection_name is 'smoke_tests' but collection_type is not 'nativeaot'. The smoke_tests collection is only meaningful for NativeAOT compilation.

Solutions

  1. Set collection_type to 'nativeaot' when using collection_name 'smoke_tests'.
  2. If you need a non-NativeAOT smoke run, choose a different collection_name that supports it.

Example fix

// before
collection_name: smoke_tests
collection_type: crossgen2
// after
collection_name: smoke_tests
collection_type: nativeaot
Defensive patterns

Strategy: validation

Validate before calling

if coreclr_args.collection_name == 'smoke_tests' and coreclr_args.collection_type != 'nativeaot':
    raise SystemExit("collection 'smoke_tests' requires collection_type='nativeaot'")

Prevention

When it happens

Trigger: Configuring a superpmi collection with collection_name=smoke_tests together with collection_type=crossgen2 (or any non-nativeaot type).

Common situations: YAML pipeline misconfiguration that reuses a crossgen2 collection_type block for the smoke_tests collection.

Related errors


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

Appendix: source

Thrown at src/coreclr/scripts/superpmi_collect_setup.py:654

        exclude_directories = list(directories_to_ignore)
        if coreclr_args.collection_name == "coreclr_tests":
            exclude_directories += ['Core_Root']

        exclude_files = list(native_binaries_to_ignore)
        if coreclr_args.collection_type == "crossgen2":
            print('Adding exclusions for crossgen2')
            # Currently, trying to crossgen2 R2RTest\Microsoft.Build.dll causes a pop-up failure, so exclude it.
            exclude_files += ["Microsoft.Build.dll"]

        if coreclr_args.collection_name == "libraries_tests":
            # libraries_tests artifacts contains files from core_root folder. Exclude them.
            core_root_dir = coreclr_args.core_root_directory
            exclude_files += [item for item in os.listdir(core_root_dir)
                              if os.path.isfile(os.path.join(core_root_dir, item)) and (item.endswith(".dll") or item.endswith(".exe"))]

        if coreclr_args.collection_name == "smoke_tests":
            if coreclr_args.collection_type != "nativeaot":
                raise RuntimeError("Collection 'smoke_tests' is only available for 'nativeaot' collections.")

        if coreclr_args.collection_name == "corelib":
            # corelib is a single-assembly crossgen2 collection over a pre-built
            # System.Private.CoreLib.dll. The YAML routes InputDirectory to:
            #   - the wasm-built corelib bin dir (artifacts/bin/coreclr/browser.wasm.Release/IL)
            #     for wasm cross-target collections, or
            #   - the host release Core_Root for non-cross-target collections.
            # Build a custom one-file input directory so the partitioning logic produces
            # exactly one helix partition. The references crossgen2 needs are resolved
            # out of the release Core_Root that's part of the correlation payload (see
            # run_crossgen2 in superpmi.py, which passes -r:<core_root>\System.*.dll etc.).
            corelib_src = os.path.join(coreclr_args.input_directory, "System.Private.CoreLib.dll")
            if not os.path.isfile(corelib_src):
                raise RuntimeError("Cannot find System.Private.CoreLib.dll at " + corelib_src)
            corelib_input_dir = os.path.join(workitem_payload_directory, "corelib_input")
            os.makedirs(corelib_input_dir, exist_ok=True)
            copy_files(coreclr_args.input_directory, corelib_input_dir, [corelib_src])
            coreclr_args.input_directory = corelib_input_dir

View on GitHub (pinned to 60108ba66e)