deepinsight/insightface · error · RuntimeError
Unsupported system: {system}
Error message
Unsupported system: {system} What it means
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.
Source
Thrown at cpp-package/inspireface/python/setup.py:82
system = platform.system().lower()
machine = platform.machine().lower()
if system == 'windows':
arch = 'x64' if machine in ['amd64', 'x86_64'] else 'arm64'
elif system == 'linux':
arch = 'x64' if machine == 'x86_64' else 'arm64'
elif system == 'darwin':
if machine == 'x86_64':
try:
is_rosetta = bool(int(subprocess.check_output(
['sysctl', '-n', 'sysctl.proc_translated']).decode().strip()))
arch = 'arm64' if is_rosetta else 'x64'
except:
arch = 'x64'
else:
arch = 'arm64'
else:
raise RuntimeError(f"Unsupported system: {system}")
return system, arch
class BinaryDistWheel(bdist_wheel):
def finalize_options(self):
super().finalize_options()
# Mark this is not a pure Python package
self.root_is_pure = False
# Set platform tag
self.plat_name = get_wheel_platform_tag()
self.universal = False
def get_target_platform_for_envs():
"""Get target platform for environments"""
system = os.environ.get('INSPIRE_FACE_TARGET_PLATFORM')
if system is None:
system = get_lib_path_info()[0]View on GitHub (pinned to 7fadd420c2)
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.
Example fix
# before
python setup.py bdist_wheel # RuntimeError: Unsupported system: freebsd
# after (patch setup.py detection)
system = platform.system().lower()
if system.startswith('freebsd'):
system = 'linux' # treat as linux-compatible for bundled .so
python setup.py bdist_wheel Defensive patterns
Strategy: validation
Validate before calling
import platform
s = platform.system().lower()
if s not in ('linux', 'darwin', 'windows'):
raise SystemExit(f'build host OS unsupported: {s}; use the official build container') Try / catch
try:
subprocess.check_call([sys.executable, '-m', 'pip', 'wheel', '.', '--no-deps'])
except subprocess.CalledProcessError:
# rebuild inside the official linux container
... Prevention
- Run packaging inside the supported build container.
- Pin CI build images by digest to avoid platform drift.
When it happens
Trigger: 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).
Common situations: Building inside unusual containers or BSD CI; mocked/broken platform module; building on an OS the project never shipped binaries for.
Related errors
AI-assisted analysis of deepinsight/insightface@7fadd420c2 (2026-08-28).
Data as JSON: /api/errors/fbfe50b55b80c77f.
Report an issue: GitHub.