{"record":{"id":"d8ea27e23fddc0f5","repo":"usestrix/strix","slug":"go-1-24-or-newer-is-required-to-build-the-bubble-t","errorCode":null,"errorMessage":"Go 1.24 or newer is required to build the Bubble Tea TUI","messagePattern":"Go 1\\.24 or newer is required to build the Bubble Tea TUI","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"scripts/tui_sidecar_hook.py","lineNumber":35,"sourceCode":"\n    The sidecar is the only interactive interface, so every wheel is a\n    platform wheel and a missing Go toolchain is a build failure.\n    \"\"\"\n\n    def initialize(self, version: str, build_data: dict[str, Any]) -> None:\n        # Editable installs run from the checkout, where the TUI is started\n        # with ``go run``; there is nothing to bundle.\n        if version == \"editable\":\n            return\n\n        root = Path(self.root)\n        executable = \"strix-tui.exe\" if os.name == \"nt\" else \"strix-tui\"\n        output = root / \"build\" / \"sidecar\" / executable\n        output.parent.mkdir(parents=True, exist_ok=True)\n\n        go = shutil.which(\"go\")\n        if go is None:\n            raise RuntimeError(\"Go 1.24 or newer is required to build the Bubble Tea TUI\")\n        env = os.environ.copy()\n        env[\"CGO_ENABLED\"] = \"0\"\n        subprocess.run(  # noqa: S603 - fixed build command using the resolved Go binary\n            [\n                go,\n                \"build\",\n                \"-trimpath\",\n                \"-ldflags=-s -w\",\n                \"-o\",\n                str(output),\n                \"./cmd/strix-tui\",\n            ],\n            cwd=root / \"strix\" / \"interface\" / \"tui\",\n            env=env,\n            check=True,\n        )\n\n        build_data[\"force_include\"][str(output)] = f\"strix/bin/{executable}\"","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/usestrix/strix/blob/85513391305171ecc6faffe03da4a8bda5e3febb/scripts/tui_sidecar_hook.py#L17-L53","documentation":"Raised by the Hatchling build hook (scripts/tui_sidecar_hook.py) when a wheel build cannot find a Go toolchain on PATH. Strix bundles its Bubble Tea TUI sidecar (strix-tui) into every wheel, so a missing Go compiler is a hard build failure, not a warning. Editable installs skip this hook because they run the TUI via `go run` from the checkout.","triggerScenarios":"Running `pip wheel .`, `python -m build`, `hatch build`, or `pip install .` (non-editable) in an environment where `shutil.which(\"go\")` returns None — i.e. the `go` binary is not on PATH.","commonSituations":"CI images (python:* Docker images, GitHub Actions ubuntu-latest without a setup-go step) that only install Python; installing from sdist on a machine where Go was installed via a tarball but not added to PATH; shell environments where GOPATH/bin or /usr/local/go/bin was never exported.","solutions":["Install Go 1.24+ (e.g. download from go.dev/dl or use actions/setup-go with go-version: '>=1.24') and confirm `go version` works in the same shell/CI step that builds the wheel","Ensure the Go bin directory (e.g. /usr/local/go/bin) is on PATH for the build process — in Dockerfiles use ENV PATH=$PATH:/usr/local/go/bin","For local development use an editable install (`pip install -e .`) which skips the sidecar build entirely and runs the TUI via `go run`","In CI, cache the Go module cache (GOPATH/pkg/mod) to speed up repeated sidecar builds"],"exampleFix":"# before (CI job with only Python installed)\n- run: pip install strix\n# after\n- uses: actions/setup-go@v5\n  with:\n    go-version: '1.24'\n- run: pip install strix","handlingStrategy":"validation","validationCode":"import shutil, subprocess\n\ndef go_toolchain_ok(min_minor: int = 24) -> bool:\n    go = shutil.which(\"go\")\n    if go is None:\n        return False\n    out = subprocess.run([go, \"version\"], capture_output=True, text=True).stdout  # e.g. go version go1.24.1 linux/amd64\n    try:\n        minor = int(out.split()[2].split(\".\")[1])\n    except (IndexError, ValueError):\n        return False\n    return minor >= min_minor\n\nassert go_toolchain_ok(), \"Install Go 1.24+ and put it on PATH before building the wheel\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install Go via the official installer or setup-go action and verify `go version` in the same CI step that builds the wheel","Use `pip install -e .` for development — the sidecar build is skipped and the TUI runs via `go run`","Add a pre-build check for the Go toolchain in CI so the failure message names the missing prerequisite"],"tags":["go","build","packaging","toolchain","ci"],"backgroundTag":null,"analyzedSha":"85513391305171ecc6faffe03da4a8bda5e3febb","analyzedAt":"2026-08-15T05:03:57.275Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}