{"record":{"id":"fbfe50b55b80c77f","repo":"deepinsight/insightface","slug":"unsupported-system-system","errorCode":null,"errorMessage":"Unsupported system: {system}","messagePattern":"Unsupported system: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"cpp-package/inspireface/python/setup.py","lineNumber":82,"sourceCode":"    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'\n            except:\n                arch = 'x64'\n        else:\n            arch = 'arm64'\n    else:\n        raise RuntimeError(f\"Unsupported system: {system}\")\n    \n    return system, arch\n\nclass BinaryDistWheel(bdist_wheel):\n    def finalize_options(self):\n        super().finalize_options()\n        # Mark this is not a pure Python package\n        self.root_is_pure = False\n        # Set platform tag\n        self.plat_name = get_wheel_platform_tag()\n        self.universal = False\n\n\ndef get_target_platform_for_envs():\n    \"\"\"Get target platform for environments\"\"\"\n    system = os.environ.get('INSPIRE_FACE_TARGET_PLATFORM')\n    if system is None:\n        system = get_lib_path_info()[0]","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/deepinsight/insightface/blob/7fadd420c2351d0ffa8cac403421c1a3ed733365/cpp-package/inspireface/python/setup.py#L64-L100","documentation":"get_lib_path_info branches on platform.system().lower() to decide library naming and host arch; any system other than the recognized ones (linux/darwin/windows) falls into the final else and raises RuntimeError(f\"Unsupported system: {system}\"). Packaging cannot proceed because it doesn't know how to locate/name the native libs for that OS.","triggerScenarios":"Running setup.py / pip wheel on a host where platform.system() is unrecognized — FreeBSD, Cygwin returning odd names, or a broken Python where system detection fails — reaching the else branch in get_lib_path_info (also hit via get_target_platform_for_envs).","commonSituations":"Building inside unusual containers or BSD CI; mocked/broken platform module; building on an OS the project never shipped binaries for.","solutions":["Build on a supported host (Linux, macOS, Windows) or the project's official build container.","On a Unix-like unsupported OS whose binaries are compatible, patch setup.py to map your system name into the linux branch.","Use the env override path (get_target_platform_for_envs) rather than native builds on unsupported hosts."],"exampleFix":"# before\npython setup.py bdist_wheel  # RuntimeError: Unsupported system: freebsd\n\n# after (patch setup.py detection)\nsystem = platform.system().lower()\nif system.startswith('freebsd'):\n    system = 'linux'  # treat as linux-compatible for bundled .so\npython setup.py bdist_wheel","handlingStrategy":"validation","validationCode":"import platform\ns = platform.system().lower()\nif s not in ('linux', 'darwin', 'windows'):\n    raise SystemExit(f'build host OS unsupported: {s}; use the official build container')","typeGuard":null,"tryCatchPattern":"try:\n    subprocess.check_call([sys.executable, '-m', 'pip', 'wheel', '.', '--no-deps'])\nexcept subprocess.CalledProcessError:\n    # rebuild inside the official linux container\n    ...","preventionTips":["Run packaging inside the supported build container.","Pin CI build images by digest to avoid platform drift."],"tags":["build","platform","setup-py","os-detection"],"backgroundTag":"unsupported-build-platform","analyzedSha":"7fadd420c2351d0ffa8cac403421c1a3ed733365","analyzedAt":"2026-08-28T15:44:01.850Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}