AlexsJones/llmfit · error · RuntimeError

No suitable wheel platform found for runtime platform

Error message

No suitable wheel platform found for runtime platform {first!r}.

What it means

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.

Solutions

  1. Build the wheel on a supported platform (the tags listed in TARGET_CONFIGS: standard x86_64/aarch64 Linux, macOS, Windows)
  2. 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
  3. If the platform should be supported, add a 'wheel_tag -> (rust_triple, binary_name)' entry to TARGET_CONFIGS in hatch_build.py and rebuild

Example fix

# before (hatch_build.py)
TARGET_CONFIGS: dict[str, tuple[str, str]] = {
    "manylinux_2_17_x86_64": ("x86_64-unknown-linux-gnu", "llmfit"),
    # ...
}

# after — support an additional platform
TARGET_CONFIGS: dict[str, tuple[str, str]] = {
    "manylinux_2_17_x86_64": ("x86_64-unknown-linux-gnu", "llmfit"),
    "manylinux_2_17_ppc64le": ("powerpc64le-unknown-linux-gnu", "llmfit"),
    # ...
}
Defensive patterns

Strategy: validation

Validate before calling

from packaging.tags import sys_tags
from hatch_build import TARGET_CONFIGS  # from llmfit-python/
if not any(t.platform in TARGET_CONFIGS for t in sys_tags()):
    raise SystemExit("host platform has no wheel config in TARGET_CONFIGS; build on a supported platform or add a mapping")

Try / catch

try:
    subprocess.run(["uv", "build"], check=True)
except subprocess.CalledProcessError:
    raise SystemExit("build failed: unsupported host platform — see TARGET_CONFIGS in hatch_build.py")

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of AlexsJones/llmfit@acc7e40c3a (2026-08-17). Data as JSON: /api/errors/4feac01f7c643476. Report an issue: GitHub.

Appendix: source

Thrown at llmfit-python/hatch_build.py:101

        metadata["readme"] = {
            "content-type": "text/markdown",
            "text": readme.read_text(encoding="utf-8"),
        }


class LlmfitBinaryBuildHook(BuildHookInterface):
    """Hatchling build hook that injects the llmfit binary into each wheel."""

    PLUGIN_NAME = "llmfit binary"

    @staticmethod
    def _detect_platform() -> str:
        """Return the best platform tag for the current machine."""
        best = next((t.platform for t in sys_tags() if t.platform in TARGET_CONFIGS), None)
        if best is not None:
            return best
        first = next(t.platform for t in sys_tags())
        raise RuntimeError(f"No suitable wheel platform found for runtime platform {first!r}.")

    @staticmethod
    def _find_binary_for_target(llmfit_root: Path, py_target: str) -> Path:
        """Find the binary compiled for a specific Rust target.

        Looks in ``target/{upstream_target}/release/``, which is where Cargo
        places the binary when built with ``--target``.
        """
        upstream_target, binary_name = TARGET_CONFIGS[py_target]
        bin_path = llmfit_root / "target" / upstream_target / "release" / binary_name
        if not bin_path.is_file():
            raise FileNotFoundError(
                f"Binary not found at {bin_path}. Expected it to be built for target {upstream_target!r}.",
            )
        return bin_path

    @staticmethod
    def _find_local_binary(llmfit_root: Path) -> Path:

View on GitHub (pinned to acc7e40c3a)