{"record":{"id":"f1753e7667ec0a44","repo":"deepinsight/insightface","slug":"unsupported-platform","errorCode":null,"errorMessage":"Unsupported platform: {} {}","messagePattern":"Unsupported platform: (.+?) (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"cpp-package/inspireface/python/setup.py","lineNumber":58,"sourceCode":"        },\n        'arm64': {\n            'windows': 'win_arm64',\n            'linux': 'manylinux2014_aarch64',\n            'darwin': 'macosx_11_0_arm64'\n        },\n        'aarch64': {\n            'windows': 'win_arm64',\n            'linux': 'manylinux2014_aarch64',\n            'darwin': 'macosx_11_0_arm64'\n        }\n    }\n    if os.getenv('INSPIRE_FACE_TARGET_AARCH_MAPPING'):\n        platform_arch = os.getenv('INSPIRE_FACE_TARGET_AARCH_MAPPING')\n    else:\n        platform_arch = arch_mapping.get(machine, {}).get(system)\n    if not platform_arch:\n        print(\"Unsupported platform: {} {}\".format(system, machine))\n        raise RuntimeError(\"Unsupported platform: {} {}\".format(system, machine))\n    \n    return platform_arch\n\ndef get_lib_path_info():\n    \"\"\"Get library file path information\"\"\"\n    system = platform.system().lower()\n    machine = platform.machine().lower()\n    \n    if system == 'windows':\n        arch = 'x64' if machine in ['amd64', 'x86_64'] else 'arm64'\n    elif system == 'linux':\n        arch = 'x64' if machine == 'x86_64' else 'arm64'\n    elif system == 'darwin':\n        if machine == 'x86_64':\n            try:\n                is_rosetta = bool(int(subprocess.check_output(\n                    ['sysctl', '-n', 'sysctl.proc_translated']).decode().strip()))\n                arch = 'arm64' if is_rosetta else 'x64'","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/deepinsight/insightface/blob/7fadd420c2351d0ffa8cac403421c1a3ed733365/cpp-package/inspireface/python/setup.py#L40-L76","documentation":"During wheel packaging, get_wheel_platform_tag maps (machine, system) through the arch_mapping table (or the INSPIRE_FACE_TARGET_AARCH_MAPPING env override) to pick a platform tag for the bundled native library. If no entry matches the build host and the env var is unset, it prints the pair and raises this RuntimeError — no prebuilt lib tag exists for this host.","triggerScenarios":"Running setup.py bdist_wheel / pip wheel on a (machine, system) pair absent from arch_mapping — e.g. windows-arm64, freebsd, or an unrecognized platform.machine() string — without setting INSPIRE_FACE_TARGET_AARCH_MAPPING.","commonSituations":"Exotic or new CI runners not in the mapping table; cross-build scripts that forgot the env override; platform.machine() returning an unexpected alias (e.g. 'AMD64' vs 'x86_64' on nonstandard hosts).","solutions":["Set INSPIRE_FACE_TARGET_AARCH_MAPPING to a valid target (e.g. 'linux/x64' or 'linux/arm64') matching the bundled libs.","Inspect the arch_mapping dict in setup.py and build on one of the listed platform/arch combinations.","If your host should be supported, verify platform.machine()/system() output and patch/extend the mapping locally."],"exampleFix":"# before\npython setup.py bdist_wheel  # RuntimeError: Unsupported platform: linux riscv64\n\n# after\nexport INSPIRE_FACE_TARGET_AARCH_MAPPING='linux/x64'\npython setup.py bdist_wheel","handlingStrategy":"validation","validationCode":"import platform, os\nkey = (platform.machine(), platform.system().lower())\nif not os.getenv('INSPIRE_FACE_TARGET_AARCH_MAPPING') and key not in KNOWN_ARCH_MAPPING:\n    raise SystemExit('set INSPIRE_FACE_TARGET_AARCH_MAPPING before building')","typeGuard":null,"tryCatchPattern":"try:\n    subprocess.check_call([sys.executable, 'setup.py', 'bdist_wheel'])\nexcept subprocess.CalledProcessError:\n    os.environ['INSPIRE_FACE_TARGET_AARCH_MAPPING'] = 'linux/x64'\n    subprocess.check_call([sys.executable, 'setup.py', 'bdist_wheel'])","preventionTips":["Build in the project's official CI/docker images.","Set INSPIRE_FACE_TARGET_AARCH_MAPPING explicitly in cross-build scripts."],"tags":["build","wheel","platform","setup-py","cross-compilation"],"backgroundTag":"unsupported-build-platform","analyzedSha":"7fadd420c2351d0ffa8cac403421c1a3ed733365","analyzedAt":"2026-08-28T15:44:01.850Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}