{"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/acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe/llmfit-python/hatch_build.py#L83-L119","documentation":"Raised by LlmfitBinaryBuildHook._detect_platform() during wheel build. It walks packaging's sys_tags() for the running interpreter and takes the first platform tag present in TARGET_CONFIGS (the supported set: manylinux_2_17 x86_64/aarch64, manylinux_2_39_riscv64, musllinux_1_2 x86_64/aarch64, macosx x86_64/arm64, win_amd64, win_arm64). If none of the interpreter's tags is a supported wheel platform, the first (most specific) tag is reported in this RuntimeError.","triggerScenarios":"Building the wheel on a host whose sys_tags() platforms never intersect TARGET_CONFIGS: 32-bit x86 Linux, FreeBSD/OpenBSD, a Linux with an unsupported manylinux micro-version priority, or an exotic Python build whose platform tag ordering does not reach any supported key.","commonSituations":"Attempting `uv build` / `pip wheel` inside an unsupported container or BSD VM; Raspberry Pi or other boards whose glibc/ARCH tag is not in the supported list; a hand-compiled Python with a nonstandard platform string.","solutions":["Build the wheel on a supported platform (the tags listed in TARGET_CONFIGS: standard x86_64/aarch64 Linux, macOS, Windows)","Cross-build instead: build on a supported host with `cargo build --release --target <triple>` and set LLMFIT_PYTHON_PLATFORM_TAG to the desired tag from TARGET_CONFIGS","If the platform should be supported, add a 'wheel_tag -> (rust_triple, binary_name)' entry to TARGET_CONFIGS in hatch_build.py and rebuild"],"exampleFix":"# before (hatch_build.py)\nTARGET_CONFIGS: dict[str, tuple[str, str]] = {\n    \"manylinux_2_17_x86_64\": (\"x86_64-unknown-linux-gnu\", \"llmfit\"),\n    # ...\n}\n\n# after — support an additional platform\nTARGET_CONFIGS: dict[str, tuple[str, str]] = {\n    \"manylinux_2_17_x86_64\": (\"x86_64-unknown-linux-gnu\", \"llmfit\"),\n    \"manylinux_2_17_ppc64le\": (\"powerpc64le-unknown-linux-gnu\", \"llmfit\"),\n    # ...\n}","handlingStrategy":"validation","validationCode":"from packaging.tags import sys_tags\nfrom hatch_build import TARGET_CONFIGS  # from llmfit-python/\nif not any(t.platform in TARGET_CONFIGS for t in sys_tags()):\n    raise SystemExit(\"host platform has no wheel config in TARGET_CONFIGS; build on a supported platform or add a mapping\")","typeGuard":null,"tryCatchPattern":"try:\n    subprocess.run([\"uv\", \"build\"], check=True)\nexcept subprocess.CalledProcessError:\n    raise SystemExit(\"build failed: unsupported host platform — see TARGET_CONFIGS in hatch_build.py\")","preventionTips":["Keep release CI on the platforms listed in TARGET_CONFIGS (x86_64/aarch64 Linux, macOS, Windows)","For niche platforms, cross-compile from a supported host via LLMFIT_PYTHON_PLATFORM_TAG","Add new platforms by extending TARGET_CONFIGS rather than patching _detect_platform"],"tags":["python","wheels","platform-tag","packaging","cross-compilation"],"backgroundTag":"unsupported-platform-tag","analyzedSha":"acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe","analyzedAt":"2026-08-17T10:35:29.658Z","contentChangedAt":"2026-08-17T10:35:29.658Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}