{"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/a9ac7ed91c1729cd93944bc1338e8313daaba8fa/llmfit-python/hatch_build.py#L158-L194","documentation":"After resolving the wheel platform (LLMFIT_PYTHON_PLATFORM_TAG if set, else auto-detected), initialize() requires it to be a key of TARGET_CONFIGS. This ValueError lists the valid tags and fires when the env var contains a tag the build system does not know - most often a differently-spelled or unsupported platform tag.","triggerScenarios":"Using legacy/alternate spellings: manylinux2014_x86_64 or manylinux_2_28_x86_64 instead of manylinux_2_17_x86_64, or musllinux_1_1_x86_64 instead of musllinux_1_2_x86_64; a typo like win-amd64 (dash) instead of win_amd64; a genuinely unsupported platform such as manylinux_2_17_ppc64le; trailing whitespace or quotes in the exported value.","commonSituations":"Copy-pasting a tag from another project's cibuildwheel config; CI scripts parameterized by platform matrix where the names drifted from hatch_build.py's TARGET_CONFIGS; shell quoting artifacts (`export TAG=\"manylinux_2_17_x86_64 \"`).","solutions":["Use exactly one of the tags printed in the message, e.g. LLMFIT_PYTHON_PLATFORM_TAG=manylinux_2_17_x86_64 (full set: 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).","Unset the variable to let the build auto-detect the host platform.","Check for whitespace/quote artifacts: `printf '[%s]\\n' \"$LLMFIT_PYTHON_PLATFORM_TAG\"`.","If you need a genuinely new platform, add it to TARGET_CONFIGS in hatch_build.py:41 with its Rust triple and binary name first."],"exampleFix":"# before\nLLMFIT_PYTHON_PLATFORM_TAG=manylinux2014_x86_64 uv build\n# ValueError: Unknown LLMFIT_PYTHON_PLATFORM_TAG='manylinux2014_x86_64'...\n\n# after\nLLMFIT_PYTHON_PLATFORM_TAG=manylinux_2_17_x86_64 uv build","handlingStrategy":"validation","validationCode":"import os\n\nVALID = {'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'}\ntag = os.environ.get('LLMFIT_PYTHON_PLATFORM_TAG', '').strip()\nif tag:\n    assert tag in VALID, f'{tag!r} invalid; choose from {sorted(VALID)} or unset to auto-detect'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy platform tags verbatim from hatch_build.py's TARGET_CONFIGS, not from other projects' configs.","Derive the tag in CI from the job's platform matrix entry that also feeds TARGET_CONFIGS, so they cannot drift.","Strip whitespace when reading the env var; quote-check exports with `printf '[%s]\\n' \"$TAG\"`.","Leave the variable unset for native builds; auto-detection is the safe default."],"tags":["python","packaging","environment-variable","build","configuration"],"backgroundTag":"invalid-build-configuration","analyzedSha":"a9ac7ed91c1729cd93944bc1338e8313daaba8fa","analyzedAt":"2026-08-16T19:19:11.438Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}