dotnet/runtime · error · RuntimeError
Collection 'smoke_tests' is only available for 'nativeaot' c
Error message
Collection 'smoke_tests' is only available for 'nativeaot' collections.
What it means
Raised in superpmi_collect_setup.py main() when collection_name=='smoke_tests' but collection_type != 'nativeaot'. The smoke_tests collection is implemented only for the native AOT compilation path.
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_dirView on GitHub (pinned to 290d5ab72c)
Solutions
- Set collection_type to 'nativeaot' when using smoke_tests.
- If you need a JIT-style collection, pick a collection_name supported by your collection_type.
- Add an explicit argument-validation matrix in your YAML to keep name/type consistent.
Example fix
// before # --collection_name smoke_tests --collection_type coreclr -> raises [193] // after --collection_name smoke_tests --collection_type nativeaot
Defensive patterns
Strategy: validation
Validate before calling
if collection_name == 'smoke_tests' and collection_type != 'nativeaot':
raise SystemExit("smoke_tests requires collection_type=nativeaot") Type guard
def collection_combo_valid(name: str, ctype: str) -> bool:
return name != 'smoke_tests' or ctype == 'nativeaot' Try / catch
try:
main(args)
except RuntimeError as e:
if 'smoke_tests' in str(e):
args.collection_type = 'nativeaot'; main(args) Prevention
- Keep a name→type allowlist in the pipeline
- Validate combos in arg parsing
- Don't reuse scenario YAMLs blindly
When it happens
Trigger: Pipeline/job sets collection_name=smoke_tests while collection_type is 'coreclr','crossgen2', etc.
Common situations: Copy-pasted a smoke_tests job but left collection_type from a JIT scenario; renaming a collection without updating its type.
Related errors
- Tiering options have no effect for nativeaot collections.
- Cannot find System.Private.CoreLib.dll at {corelib_src}
- Invalid runtime config, cannot initialize the runtime.
- Unsupported OS.
- Tiering options have no effect for pmi or crossgen2 collecti
AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06).
Data as JSON: /api/errors/03ce7d27269b7134.
Report an issue: GitHub.