{"record":{"id":"6424391c2a97e4f0","repo":"dotnet/maui","slug":"unsupported-distro","errorCode":null,"errorMessage":"Unsupported distro","messagePattern":"Unsupported distro","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"eng/common/cross/install-debs.py","lineNumber":314,"sourceCode":"if __name__ == \"__main__\":\n    parser = argparse.ArgumentParser(description=\"Generate rootfs for .NET runtime on Debian-like OS\")\n    parser.add_argument(\"--distro\", required=False, help=\"Distro name (e.g., debian, ubuntu, etc.)\")\n    parser.add_argument(\"--arch\", required=True, help=\"Architecture (e.g., amd64, loong64, etc.)\")\n    parser.add_argument(\"--rootfsdir\", required=True, help=\"Destination directory.\")\n    parser.add_argument('--suite', required=True, action='append', help='Specify one or more repository suites to collect index data.')\n    parser.add_argument(\"--mirror\", required=False, help=\"Mirror (e.g., http://ftp.debian.org/debian-ports etc.)\")\n    parser.add_argument(\"--artool\", required=False, default=\"ar\", help=\"ar tool to extract debs (e.g., ar, llvm-ar etc.)\")\n    parser.add_argument(\"packages\", nargs=\"+\", help=\"List of package names to be installed.\")\n\n    args = parser.parse_args()\n\n    if args.mirror is None:\n        if args.distro == \"ubuntu\":\n            args.mirror = \"http://archive.ubuntu.com/ubuntu\" if args.arch in [\"amd64\", \"i386\"] else \"http://ports.ubuntu.com/ubuntu-ports\"\n        elif args.distro == \"debian\":\n            args.mirror = \"http://ftp.debian.org/debian-ports\"\n        else:\n            raise Exception(\"Unsupported distro\")\n\n    DESIRED_PACKAGES = args.packages + [ # base packages\n        \"dpkg\",\n        \"busybox\",\n        \"libc-bin\",\n        \"base-files\",\n        \"base-passwd\",\n        \"debianutils\"\n    ]\n\n    print(f\"Creating rootfs. rootfsdir: {args.rootfsdir}, distro: {args.distro}, arch: {args.arch}, suites: {args.suite}, mirror: {args.mirror}\")\n\n    package_index_content = asyncio.run(download_package_index_parallel(args.mirror, args.arch, args.suite))\n\n    packages_info, aliases = parse_package_index(package_index_content)\n\n    with tempfile.TemporaryDirectory() as tmp_dir:\n        install_packages(args.mirror, packages_info, aliases, tmp_dir, args.rootfsdir, args.artool, DESIRED_PACKAGES)","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/eng/common/cross/install-debs.py#L296-L332","documentation":"main() raises a bare Exception('Unsupported distro') when --distro is neither 'ubuntu' nor 'debian' and no --mirror was supplied. The default-mirror selection logic only knows how to pick a mirror for those two distros; any other distro string without an explicit mirror cannot proceed.","triggerScenarios":"Running install-debs.py with `--distro fedora` (or arch, alpine, etc.) and omitting --mirror. The conditional in main falls through to the else branch and aborts.","commonSituations":"Targeting a non-Debian-family distro, a typo in --distro, or testing a new distro without providing its mirror.","solutions":["Pass `--mirror http://your.mirror/path` explicitly when using a distro other than ubuntu/debian.","Double-check the --distro spelling; only 'ubuntu' and 'debian' are recognized for auto-mirror.","If you need a new distro, extend the conditional to map it to its default mirror.","Ensure the script's package index URL layout matches your chosen mirror."],"exampleFix":"# before\npython install-debs.py --distro fedora --arch x86_64 --suite 39 <pkgs>\n\n# after\npython install-debs.py --distro fedora --arch x86_64 --suite 39 --mirror http://download.fedoraproject.org/pub/fedora/linux <pkgs>","handlingStrategy":"validation","validationCode":"if args.distro not in ('ubuntu', 'debian') and args.mirror is None:\n    raise Exception(\"Pass --mirror for unsupported distros\")","typeGuard":"def needs_explicit_mirror(distro, mirror): return distro not in ('ubuntu','debian') and not mirror","tryCatchPattern":"try:\n    main()\nexcept Exception as e:\n    if 'Unsupported distro' in str(e): print('Pass --mirror explicitly')","preventionTips":["Pass --mirror for any distro outside ubuntu/debian.","Spell --distro exactly as one of the supported values.","Extend the mirror-selection map when adding a new distro."],"tags":["python","cross-build","rootfs","configuration"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}