{"record":{"id":"4feac01f7c643476","repo":"AlexsJones/llmfit","slug":"no-suitable-wheel-platform-found-for-runtime-platf","errorCode":null,"errorMessage":"No suitable wheel platform found for runtime platform {first!r}.","messagePattern":"No suitable wheel platform found for runtime platform (.+?)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"llmfit-python/hatch_build.py","lineNumber":101,"sourceCode":"        metadata[\"readme\"] = {\n            \"content-type\": \"text/markdown\",\n            \"text\": readme.read_text(encoding=\"utf-8\"),\n        }\n\n\nclass LlmfitBinaryBuildHook(BuildHookInterface):\n    \"\"\"Hatchling build hook that injects the llmfit binary into each wheel.\"\"\"\n\n    PLUGIN_NAME = \"llmfit binary\"\n\n    @staticmethod\n    def _detect_platform() -> str:\n        \"\"\"Return the best platform tag for the current machine.\"\"\"\n        best = next((t.platform for t in sys_tags() if t.platform in TARGET_CONFIGS), None)\n        if best is not None:\n            return best\n        first = next(t.platform for t in sys_tags())\n        raise RuntimeError(f\"No suitable wheel platform found for runtime platform {first!r}.\")\n\n    @staticmethod\n    def _find_binary_for_target(llmfit_root: Path, py_target: str) -> Path:\n        \"\"\"Find the binary compiled for a specific Rust target.\n\n        Looks in ``target/{upstream_target}/release/``, which is where Cargo\n        places the binary when built with ``--target``.\n        \"\"\"\n        upstream_target, binary_name = TARGET_CONFIGS[py_target]\n        bin_path = llmfit_root / \"target\" / upstream_target / \"release\" / binary_name\n        if not bin_path.is_file():\n            raise FileNotFoundError(\n                f\"Binary not found at {bin_path}. Expected it to be built for target {upstream_target!r}.\",\n            )\n        return bin_path\n\n    @staticmethod\n    def _find_local_binary(llmfit_root: Path) -> Path:","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/AlexsJones/llmfit/blob/a9ac7ed91c1729cd93944bc1338e8313daaba8fa/llmfit-python/hatch_build.py#L83-L119","documentation":"LlmfitBinaryBuildHook._detect_platform() walks packaging.tags.sys_tags() for the running interpreter and returns the first tag present in TARGET_CONFIGS (nine supported platforms: manylinux/musllinux x86_64+aarch64+riscv64, macOS x86_64+arm64, win_amd64+win_arm64). If none match, it raises RuntimeError naming the machine's best tag - the host has no wheel/binary configuration, so no llmfit wheel can be produced natively on it.","triggerScenarios":"Building the wheel on an unsupported OS or CPU: FreeBSD (platform tag like freebsd_14_amd64), Linux ppc64le/s390x, 32-bit x86, or a Python whose sys_tags() yields a legacy tag such as linux_x86_64 before any manylinux tag; also a Python too old for the manylinux_2_17 tag priority on an odd distro.","commonSituations":"A CI matrix job scheduled on an unsupported architecture; attempting `pip install llmfit` from sdist on exotic hardware; running the build inside an unusual container (e.g. Alpine with a nonstandard musl tag ordering).","solutions":["Build on one of the supported platforms instead: x86_64 or aarch64 Linux runners, macOS 11+ arm64 / macOS 10.12+ x86_64, or Windows amd64/arm64.","Cross-build from a supported host: `LLMFIT_PYTHON_PLATFORM_TAG=<tag> cargo build --release --target <triple>` then `LLMFIT_PYTHON_PLATFORM_TAG=<tag> uv build`.","If the platform genuinely must be supported, add an entry mapping it to a Rust triple in TARGET_CONFIGS in hatch_build.py:41 and teach CI to build that target.","Print `python -c \"from packaging.tags import sys_tags; print([t.platform for t in sys_tags()][:5])\"` to confirm which tag your interpreter advertises."],"exampleFix":"# before - building natively on an unsupported host\nuv build  # RuntimeError: No suitable wheel platform found for runtime platform 'linux_ppc64le'.\n\n# after - cross-build from a supported x86_64 host\ncargo build --release --target powerpc64le-unknown-linux-gnu  # requires TARGET_CONFIGS entry\n# or simply run the build on a supported runner (ubuntu-x86_64):\n#   cargo build --release --target x86_64-unknown-linux-gnu && LLMFIT_PYTHON_PLATFORM_TAG=manylinux_2_17_x86_64 uv build","handlingStrategy":"validation","validationCode":"from packaging.tags import sys_tags\nSUPPORTED = {\n    'manylinux_2_17_x86_64', 'manylinux_2_17_aarch64', 'manylinux_2_39_riscv64',\n    'musllinux_1_2_x86_64', 'musllinux_1_2_aarch64',\n    'macosx_10_12_x86_64', 'macosx_11_0_arm64', 'win_amd64', 'win_arm64',\n}\nhost_tag = next((t.platform for t in sys_tags() if t.platform in SUPPORTED), None)\nif host_tag is None:\n    sys.exit(f'Unsupported host {next(t.platform for t in sys_tags())!r}; build on/cross from a supported platform')","typeGuard":null,"tryCatchPattern":"try:\n    hook_platform = detect_supported_platform()\nexcept RuntimeError as e:\n    if 'No suitable wheel platform' in str(e):\n        switch_ci_runner_to_supported_arch()\n    raise","preventionTips":["Pin CI build matrices to x86_64/aarch64 Linux, macOS arm64/x86_64, or Windows amd64/arm64 runners.","Check `python -c \"from packaging.tags import sys_tags; ...\"` in a smoke step before the expensive build.","For new architectures, plan a cross-compile pipeline (rustup target + LLMFIT_PYTHON_PLATFORM_TAG) rather than native builds.","Fail CI early on unsupported runners instead of discovering it at wheel-build time."],"tags":["python","packaging","platform","cross-compilation","build"],"backgroundTag":"unsupported-platform","analyzedSha":"a9ac7ed91c1729cd93944bc1338e8313daaba8fa","analyzedAt":"2026-08-16T19:19:11.438Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}