{"record":{"id":"6316576e47b898f4","repo":"oraios/serena","slug":"zig-is-not-installed-please-install-zig-from-http","errorCode":null,"errorMessage":"Zig is not installed. Please install Zig from https://ziglang.org/download/ and make sure it is added to your PATH.","messagePattern":"Zig is not installed\\. Please install Zig from https://ziglang\\.org/download/ and make sure it is added to your PATH\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/zls.py","lineNumber":77,"sourceCode":"    def _check_zls_installed() -> bool:\n        \"\"\"Check if ZLS is installed in the system.\"\"\"\n        return shutil.which(\"zls\") is not None\n\n    @staticmethod\n    def _setup_runtime_dependency() -> bool:\n        \"\"\"\n        Check if required Zig runtime dependencies are available.\n        Raises RuntimeError with helpful message if dependencies are missing.\n        \"\"\"\n        # Check for Windows and provide error message\n        if platform.system() == \"Windows\":\n            raise RuntimeError(\n                \"Windows is not supported by ZLS in this integration. Cross-file references don't work reliably on Windows. Reason unknown.\"\n            )\n\n        zig_version = ZigLanguageServer._get_zig_version()\n        if not zig_version:\n            raise RuntimeError(\n                \"Zig is not installed. Please install Zig from https://ziglang.org/download/ and make sure it is added to your PATH.\"\n            )\n\n        if not ZigLanguageServer._check_zls_installed():\n            zls_version = ZigLanguageServer._get_zls_version()\n            if not zls_version:\n                raise RuntimeError(\n                    \"Found Zig but ZLS (Zig Language Server) is not installed.\\n\"\n                    \"Please install ZLS from https://github.com/zigtools/zls\\n\"\n                    \"You can install it via:\\n\"\n                    \"  - Package managers (brew install zls, scoop install zls, etc.)\\n\"\n                    \"  - Download pre-built binaries from GitHub releases\\n\"\n                    \"  - Build from source with: zig build -Doptimize=ReleaseSafe\\n\\n\"\n                    \"After installation, make sure 'zls' is added to your PATH.\"\n                )\n\n        return True\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/zls.py#L59-L95","documentation":"Raised as RuntimeError when the Zig compiler cannot be detected: _get_zig_version() returns no version because the zig executable is missing from PATH. ZLS requires a Zig installation to operate, so startup aborts with a pointer to the official download.","triggerScenarios":"ZigLanguageServer.__init__ → _setup_runtime_dependency calls ZigLanguageServer._get_zig_version() on a non-Windows platform and gets a falsy result (zig not on PATH or failing to report a version).","commonSituations":"Zig never installed; zig installed via snapshot/zip download but its directory not added to PATH; version managers (e.g. zigup, asdf) not activated in the shell that runs the server; broken zig binary that exits nonzero.","solutions":["Install Zig from https://ziglang.org/download/ (or via a package manager: apt, brew, scoop, zigup).","Add the directory containing the zig executable to your PATH.","Verify with `zig version` in the same shell/CI environment that runs the language server.","Point ls_specific_settings.zig/zls at the binaries if PATH cannot be modified.","Fix the broken zig installation if `zig version` errors despite zig being on PATH."],"exampleFix":"// before\n# zig: command not found\nls = SolidLSP(\"zig\", \"/repo\")  # RuntimeError\n// after\n# export PATH=$PATH:/opt/zig-x86_64-linux-0.13.0\n# zig version  # 0.13.0\nls = SolidLSP(\"zig\", \"/repo\")  # starts","handlingStrategy":"validation","validationCode":"import shutil, subprocess\nzig = shutil.which(\"zig\")\nif not zig:\n    raise SystemExit(\"Zig is not installed; see https://ziglang.org/download/\")\nsubprocess.run([zig, \"version\"], check=True, capture_output=True)  # binary must actually work","typeGuard":"def zig_available() -> bool:\n    import shutil, subprocess\n    z = shutil.which(\"zig\")\n    if not z:\n        return False\n    r = subprocess.run([z, \"version\"], capture_output=True)\n    return r.returncode == 0 and bool(r.stdout.strip())","tryCatchPattern":"try:\n    ls = SolidLSP(\"zig\", repo_path)\nexcept RuntimeError as e:\n    if \"Zig is not installed\" in str(e):\n        subprocess.run([\"zigup\", \"install\"], check=True)  # or install via package manager, then retry\n        ls = SolidLSP(\"zig\", repo_path)\n    else:\n        raise","preventionTips":["Install Zig and add it to PATH in every environment (dev machine, CI image).","Run `zig version` as a preflight check in CI before Zig analysis jobs.","If using version managers (zigup/asdf), ensure they are activated in the executing shell.","Point ls_specific_settings.zig at an explicit zig path when PATH cannot be controlled."],"tags":["installation","zig","missing-dependency","path"],"backgroundTag":"missing-executable-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}