{"record":{"id":"30812074ffdcc417","repo":"oraios/serena","slug":"clojure-spath-failed-please-upgrade-to-clojure","errorCode":null,"errorMessage":"`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1.10.","messagePattern":"`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1\\.10\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/clojure_lsp.py","lineNumber":82,"sourceCode":"        stdout=subprocess.PIPE if capture_output else None,\n        stderr=subprocess.STDOUT if capture_output else None,\n        text=True,\n        check=True,\n    )\n\n\ndef verify_clojure_cli() -> None:\n    install_msg = \"Please install the official Clojure CLI from:\\n  https://clojure.org/guides/getting_started\"\n    if shutil.which(\"clojure\") is None:\n        raise FileNotFoundError(\"`clojure` not found.\\n\" + install_msg)\n\n    help_proc = run_command([\"clojure\", \"--help\"])\n    if \"-Aaliases\" not in help_proc.stdout:\n        raise RuntimeError(\"Detected a Clojure executable, but it does not support '-Aaliases'.\\n\" + install_msg)\n\n    spath_proc = run_command([\"clojure\", \"-Spath\"], capture_output=False)\n    if spath_proc.returncode != 0:\n        raise RuntimeError(\"`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1.10.\")\n\n\nclass ClojureLSP(SolidLanguageServer):\n    \"\"\"\n    Provides a clojure-lsp specific instantiation of the LanguageServer class.\n\n    You can pass the following entries in ``ls_specific_settings[\"clojure\"]``:\n        - clojure_lsp_version: Override the pinned clojure-lsp version downloaded\n          by Serena (default: the bundled Serena version).\n        - source_paths: Explicit list of source paths (repo-root-relative) to\n          inject into clojure-lsp's ``initializationOptions``. Skips both the\n          ``.lsp/config.edn`` lookup and the project-tree scan.\n        - config_edn_path: Path to a ``config.edn`` file whose ``:source-paths``\n          entry should be parsed and injected. Skips the project-tree scan but\n          is itself skipped if ``source_paths`` is also set.\n\n    Source-path resolution order (first match wins):\n        1. ``source_paths`` setting (explicit override)","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/clojure_lsp.py#L64-L100","documentation":"Raised by verify_clojure_cli when the `clojure -Spath` command exits with a non-zero status. The library requires the Clojure CLI (clj/clojure) to support `-Spath`, which was introduced in CLI 1.10, to resolve classpaths for clojure-lsp. An old or broken CLI installation cannot provide that classpath, so setup aborts.","triggerScenarios":"Calling clojure_lsp setup (_get_or_install_core_dependency) or _test_clojure_cli when an installed `clojure` executable returns non-zero from `clojure -Spath` — typically a CLI older than 1.10, or a broken deps.edn/config causing -Spath to fail.","commonSituations":"Developers on old distro-packaged Clojure CLI versions (e.g. Ubuntu apt packages pre-1.10), corrupted ~/.clojure/.cpcache, or invalid deps.edn that makes -Spath fail even on a recent CLI.","solutions":["Upgrade the Clojure CLI to >= 1.10 (install from https://clojure.org/guides/install_clojure or use brew/apt official packages)","Run `clojure -Spath` manually to see the underlying failure and fix your deps.edn or clear ~/.clojure/.cpcache","Remove the distro `clojure` package and install the official Clojure CLI tools","Set/verify PATH so the modern CLI is the one found first"],"exampleFix":"// before\n$ clojure -Sversion\nClojure CLI version 1.9.0.397 // too old\n// after\n$ curl -O https://download.clojure.org/install/linux-install-1.11.1.1435.sh\n$ sudo bash linux-install-1.11.1.1435.sh\n$ clojure -Spath # succeeds","handlingStrategy":"validation","validationCode":"import subprocess, shutil\ndef is_clojure_cli_ok():\n    if shutil.which(\"clojure\") is None:\n        return False, \"clojure not on PATH\"\n    help_out = subprocess.run([\"clojure\", \"--help\"], capture_output=True, text=True)\n    if \"-Aaliases\" not in help_out.stdout:\n        return False, \"CLI too old: no -Aaliases support\"\n    sp = subprocess.run([\"clojure\", \"-Spath\"], capture_output=True, text=True)\n    return sp.returncode == 0, sp.stderr\n","typeGuard":"def has_modern_clojure_cli() -> bool:\n    import subprocess\n    try:\n        return subprocess.run([\"clojure\", \"-Spath\"], capture_output=True, timeout=30).returncode == 0\n    except (OSError, subprocess.TimeoutExpired):\n        return False\n","tryCatchPattern":"try:\n    server = ClojureLSP(repo_path)\nexcept RuntimeError as e:\n    if \"-Spath\" in str(e):\n        fix_clojure_cli_install()  # upgrade CLI, clear ~/.clojure/.cpcache\n        server = ClojureLSP(repo_path)\n    else:\n        raise\n","preventionTips":["Install the official Clojure CLI (>= 1.10) from clojure.org instead of distro packages","Run `clojure -Spath` in your setup/CI script before starting the language server","Keep ~/.clojure/.cpcache clean and deps.edn valid","Pin the CLI version in dev containers/CI images"],"tags":["clojure","dependency-setup","version-compatibility"],"backgroundTag":"outdated-toolchain","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}