{"record":{"id":"03ce7d27269b7134","repo":"dotnet/runtime","slug":"collection-smoke-tests-is-only-available-for-na","errorCode":null,"errorMessage":"Collection 'smoke_tests' is only available for 'nativeaot' collections.","messagePattern":"Collection 'smoke_tests' is only available for 'nativeaot' collections\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/superpmi_collect_setup.py","lineNumber":654,"sourceCode":"        exclude_directories = list(directories_to_ignore)\n        if coreclr_args.collection_name == \"coreclr_tests\":\n            exclude_directories += ['Core_Root']\n\n        exclude_files = list(native_binaries_to_ignore)\n        if coreclr_args.collection_type == \"crossgen2\":\n            print('Adding exclusions for crossgen2')\n            # Currently, trying to crossgen2 R2RTest\\Microsoft.Build.dll causes a pop-up failure, so exclude it.\n            exclude_files += [\"Microsoft.Build.dll\"]\n\n        if coreclr_args.collection_name == \"libraries_tests\":\n            # libraries_tests artifacts contains files from core_root folder. Exclude them.\n            core_root_dir = coreclr_args.core_root_directory\n            exclude_files += [item for item in os.listdir(core_root_dir)\n                              if os.path.isfile(os.path.join(core_root_dir, item)) and (item.endswith(\".dll\") or item.endswith(\".exe\"))]\n\n        if coreclr_args.collection_name == \"smoke_tests\":\n            if coreclr_args.collection_type != \"nativeaot\":\n                raise RuntimeError(\"Collection 'smoke_tests' is only available for 'nativeaot' collections.\")\n\n        if coreclr_args.collection_name == \"corelib\":\n            # corelib is a single-assembly crossgen2 collection over a pre-built\n            # System.Private.CoreLib.dll. The YAML routes InputDirectory to:\n            #   - the wasm-built corelib bin dir (artifacts/bin/coreclr/browser.wasm.Release/IL)\n            #     for wasm cross-target collections, or\n            #   - the host release Core_Root for non-cross-target collections.\n            # Build a custom one-file input directory so the partitioning logic produces\n            # exactly one helix partition. The references crossgen2 needs are resolved\n            # out of the release Core_Root that's part of the correlation payload (see\n            # run_crossgen2 in superpmi.py, which passes -r:<core_root>\\System.*.dll etc.).\n            corelib_src = os.path.join(coreclr_args.input_directory, \"System.Private.CoreLib.dll\")\n            if not os.path.isfile(corelib_src):\n                raise RuntimeError(\"Cannot find System.Private.CoreLib.dll at \" + corelib_src)\n            corelib_input_dir = os.path.join(workitem_payload_directory, \"corelib_input\")\n            os.makedirs(corelib_input_dir, exist_ok=True)\n            copy_files(coreclr_args.input_directory, corelib_input_dir, [corelib_src])\n            coreclr_args.input_directory = corelib_input_dir","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/superpmi_collect_setup.py#L636-L672","documentation":"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.","triggerScenarios":"Pipeline/job sets collection_name=smoke_tests while collection_type is 'coreclr','crossgen2', etc.","commonSituations":"Copy-pasted a smoke_tests job but left collection_type from a JIT scenario; renaming a collection without updating its type.","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."],"exampleFix":"// before\n# --collection_name smoke_tests --collection_type coreclr -> raises [193]\n// after\n--collection_name smoke_tests --collection_type nativeaot","handlingStrategy":"validation","validationCode":"if collection_name == 'smoke_tests' and collection_type != 'nativeaot':\n    raise SystemExit(\"smoke_tests requires collection_type=nativeaot\")","typeGuard":"def collection_combo_valid(name: str, ctype: str) -> bool:\n    return name != 'smoke_tests' or ctype == 'nativeaot'","tryCatchPattern":"try:\n    main(args)\nexcept RuntimeError as e:\n    if 'smoke_tests' in str(e):\n        args.collection_type = 'nativeaot'; main(args)","preventionTips":["Keep a name→type allowlist in the pipeline","Validate combos in arg parsing","Don't reuse scenario YAMLs blindly"],"tags":["configuration","nativeaot","superpmi","validation"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}