{"record":{"id":"c9afd108558c2372","repo":"AlexsJones/llmfit","slug":"unknown-llmfit-python-platform-tag-py-target-r","errorCode":null,"errorMessage":"Unknown LLMFIT_PYTHON_PLATFORM_TAG={py_target!r}. Must be one of: {sorted(TARGET_CONFIGS)}","messagePattern":"Unknown LLMFIT_PYTHON_PLATFORM_TAG=(.+?)\\. Must be one of: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"llmfit-python/hatch_build.py","lineNumber":176,"sourceCode":"            raise RuntimeError(\n                f\"Binary version mismatch: binary at {bin_path} reports {binary_version!r} \"\n                f\"but Cargo.toml (or LLMFIT_VERSION) says {expected_version!r}. \"\n                \"Run 'make build' to recompile.\",\n            )\n        print(f\"  Binary version OK ({binary_version})\")\n\n    def initialize(self, version: str, build_data: dict) -> None:\n        \"\"\"Locate the platform binary and configure the wheel before it is built.\"\"\"\n        py_target_from_env = os.environ.get(\"LLMFIT_PYTHON_PLATFORM_TAG\")\n        if version == \"editable\" and py_target_from_env:\n            raise ValueError(\n                \"LLMFIT_PYTHON_PLATFORM_TAG is not supported for editable installs. \"\n                \"Let the build system detect the host platform instead.\",\n            )\n        running_platform = self._detect_platform()\n        py_target = py_target_from_env or running_platform\n        if py_target not in TARGET_CONFIGS:\n            raise ValueError(\n                f\"Unknown LLMFIT_PYTHON_PLATFORM_TAG={py_target!r}. Must be one of: {sorted(TARGET_CONFIGS)}\",\n            )\n\n        upstream_target, binary_name = TARGET_CONFIGS[py_target]\n        pypi_version: str = self.metadata.version\n\n        print(f\"  target={upstream_target}  version={pypi_version}  wheel tag=py3-none-{py_target}\")\n\n        llmfit_root = Path(self.root).parent\n        if version == \"editable\":\n            # For editable installs, look for target/debug/llmfit or target/release/llmfit (or llmfit.exe on Windows).\n            bin_path = self._find_local_binary(llmfit_root)\n        elif version == \"standard\":\n            # For release installs, look for e.g. target/x86_64-unknown-linux-gnu/release/llmfit on Linux.\n            bin_path = self._find_binary_for_target(llmfit_root, py_target)\n        else:\n            raise ValueError(f\"Unknown version: {version!r}\")\n","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/AlexsJones/llmfit/blob/acc7e40c3a0afbd36510a92f2f8f3d5177cfc0fe/llmfit-python/hatch_build.py#L158-L194","documentation":"Raised in initialize() when LLMFIT_PYTHON_PLATFORM_TAG is set to a value that is not a key of TARGET_CONFIGS. The message helpfully lists the exact sorted set of supported tags (manylinux_2_17_x86_64, manylinux_2_17_aarch64, manylinux_2_39_riscv64, musllinux_1_2_x86_64, musllinux_1_2_aarch64, macosx_10_12_x86_64, macosx_11_0_arm64, win_amd64, win_arm64). Typos, CPython-specific variants, or tags belonging to another packaging scheme are rejected before any binary lookup.","triggerScenarios":"Setting LLMFIT_PYTHON_PLATFORM_TAG=linux_x86_64 (the naive form instead of manylinux_2_17_x86_64), =manylinux_2_28_aarch64 (unsupported micro version), =macosx_14_0_arm64 (version above the registered 11_0 key), or any misspelling, then running a standard build.","commonSituations":"Guessing the tag from `pip debug --verbose` output (which lists many candidates, only some of which are configured here); copying a tag from another project's CI; CI matrix drift after TARGET_CONFIGS gains/loses entries.","solutions":["Copy a tag verbatim from the error message's sorted(TARGET_CONFIGS) list — e.g. manylinux_2_17_x86_64, macosx_11_0_arm64, win_amd64","Unset the variable to let the hook autodetect the running platform: `unset LLMFIT_PYTHON_PLATFORM_TAG && uv build`","If you truly need a new tag (e.g. a newer macOS or manylinux micro version), add it to TARGET_CONFIGS in hatch_build.py first"],"exampleFix":"# before\nexport LLMFIT_PYTHON_PLATFORM_TAG=linux_x86_64\nuv build  # ValueError: Unknown LLMFIT_PYTHON_PLATFORM_TAG\n\n# after\nexport LLMFIT_PYTHON_PLATFORM_TAG=manylinux_2_17_x86_64\nuv build","handlingStrategy":"validation","validationCode":"import os\nfrom hatch_build import TARGET_CONFIGS\ntag = os.environ.get(\"LLMFIT_PYTHON_PLATFORM_TAG\")\nif tag and tag not in TARGET_CONFIGS:\n    raise SystemExit(f\"bad LLMFIT_PYTHON_PLATFORM_TAG={tag!r}; valid: {sorted(TARGET_CONFIGS)}\")","typeGuard":"def is_valid_platform_tag(tag: str) -> bool:\n    \"\"\"True when tag is a supported wheel platform in TARGET_CONFIGS.\"\"\"\n    from hatch_build import TARGET_CONFIGS\n    return tag in TARGET_CONFIGS","tryCatchPattern":"try:\n    hook.initialize(\"standard\", build_data)\nexcept ValueError as e:\n    raise SystemExit(f\"platform tag rejected: {e}\")","preventionTips":["Copy tags verbatim from the sorted(TARGET_CONFIGS) list in the error message","Generate CI matrix values from TARGET_CONFIGS itself instead of hand-listing tags","When unsure, unset the variable and rely on host autodetection"],"tags":["python","env-var","platform-tag","packaging"],"backgroundTag":"invalid-env-var-value","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"}