{"record":{"id":"5e0e52aa7a981b71","repo":"AlexsJones/llmfit","slug":"llmfit-python-platform-tag-is-not-supported-for-ed","errorCode":null,"errorMessage":"LLMFIT_PYTHON_PLATFORM_TAG is not supported for editable installs. Let the build system detect the host platform instead.","messagePattern":"LLMFIT_PYTHON_PLATFORM_TAG is not supported for editable installs\\. Let the build system detect the host platform instead\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"llmfit-python/hatch_build.py","lineNumber":169,"sourceCode":"        )\n        output = result.stdout.strip()  # e.g. \"llmfit 0.9.8\"\n        match = re.match(r\"^llmfit v?(\\d+\\.\\d+\\.\\d+)$\", output)\n        if not match:\n            raise RuntimeError(f\"Unexpected output from '{bin_path} --version': {output!r}\")\n        binary_version = match.group(1)\n        if binary_version != expected_version:\n            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).","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/AlexsJones/llmfit/blob/a9ac7ed91c1729cd93944bc1338e8313daaba8fa/llmfit-python/hatch_build.py#L151-L187","documentation":"initialize() rejects the combination of an editable build (version == 'editable', i.e. uv sync / pip install -e) with LLMFIT_PYTHON_PLATFORM_TAG set in the environment. Editable installs always use the locally compiled host binary from target/debug or target/release, so choosing a wheel platform for them is meaningless and would silently package the wrong artifact; the ValueError fails fast instead.","triggerScenarios":"Running `LLMFIT_PYTHON_PLATFORM_TAG=manylinux_2_17_aarch64 uv sync` or `... pip install -e .`; a CI job that exports the variable for a cross-build wheel stage and then reuses the same env for an editable-install test stage; the variable exported in ~/.bashrc or a direnv file leaking into local installs.","commonSituations":"Release pipelines that build multiple platform wheels in one runner and later run editable-based test suites without cleaning env; developers following the cross-compile docs and then trying a normal `uv run`.","solutions":["Unset the variable for the editable step: `unset LLMFIT_PYTHON_PLATFORM_TAG && uv sync`.","Split cross-build and editable/test steps into separate CI jobs or env blocks so the tag never leaks.","Check `env | grep LLMFIT` to find stray exports from shell rc files or direnv.","Only set the variable for standard wheel builds (`uv build`) where a cross-compiled target actually applies."],"exampleFix":"# before\nexport LLMFIT_PYTHON_PLATFORM_TAG=manylinux_2_17_aarch64\nuv sync  # ValueError: not supported for editable installs\n\n# after\nunset LLMFIT_PYTHON_PLATFORM_TAG\nuv sync","handlingStrategy":"validation","validationCode":"import os\n\nif os.environ.get('UV_BUILD_MODE', 'editable') == 'editable':\n    os.environ.pop('LLMFIT_PYTHON_PLATFORM_TAG', None)  # editable installs must not pin a platform","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scope LLMFIT_PYTHON_PLATFORM_TAG to the single cross-build command line (`VAR=... uv build`), never `export` it job-wide.","Run editable installs (uv sync, pip install -e) in a clean env: `env -u LLMFIT_PYTHON_PLATFORM_TAG uv sync`.","Audit direnv/.bashrc/CI env blocks for leftover release variables."],"tags":["python","packaging","environment-variable","editable-install","build"],"backgroundTag":"unsupported-build-option","analyzedSha":"a9ac7ed91c1729cd93944bc1338e8313daaba8fa","analyzedAt":"2026-08-16T19:19:11.438Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}