oraios/serena · error · RuntimeError
`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1.1
Error message
`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1.10.
What it means
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.
Source
Thrown at src/solidlsp/language_servers/clojure_lsp.py:82
stdout=subprocess.PIPE if capture_output else None,
stderr=subprocess.STDOUT if capture_output else None,
text=True,
check=True,
)
def verify_clojure_cli() -> None:
install_msg = "Please install the official Clojure CLI from:\n https://clojure.org/guides/getting_started"
if shutil.which("clojure") is None:
raise FileNotFoundError("`clojure` not found.\n" + install_msg)
help_proc = run_command(["clojure", "--help"])
if "-Aaliases" not in help_proc.stdout:
raise RuntimeError("Detected a Clojure executable, but it does not support '-Aaliases'.\n" + install_msg)
spath_proc = run_command(["clojure", "-Spath"], capture_output=False)
if spath_proc.returncode != 0:
raise RuntimeError("`clojure -Spath` failed; please upgrade to Clojure CLI ≥ 1.10.")
class ClojureLSP(SolidLanguageServer):
"""
Provides a clojure-lsp specific instantiation of the LanguageServer class.
You can pass the following entries in ``ls_specific_settings["clojure"]``:
- clojure_lsp_version: Override the pinned clojure-lsp version downloaded
by Serena (default: the bundled Serena version).
- source_paths: Explicit list of source paths (repo-root-relative) to
inject into clojure-lsp's ``initializationOptions``. Skips both the
``.lsp/config.edn`` lookup and the project-tree scan.
- config_edn_path: Path to a ``config.edn`` file whose ``:source-paths``
entry should be parsed and injected. Skips the project-tree scan but
is itself skipped if ``source_paths`` is also set.
Source-path resolution order (first match wins):
1. ``source_paths`` setting (explicit override)View on GitHub (pinned to 7fcbca7e62)
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
Example fix
// before $ clojure -Sversion Clojure CLI version 1.9.0.397 // too old // after $ curl -O https://download.clojure.org/install/linux-install-1.11.1.1435.sh $ sudo bash linux-install-1.11.1.1435.sh $ clojure -Spath # succeeds
Defensive patterns
Strategy: validation
Validate before calling
import subprocess, shutil
def is_clojure_cli_ok():
if shutil.which("clojure") is None:
return False, "clojure not on PATH"
help_out = subprocess.run(["clojure", "--help"], capture_output=True, text=True)
if "-Aaliases" not in help_out.stdout:
return False, "CLI too old: no -Aaliases support"
sp = subprocess.run(["clojure", "-Spath"], capture_output=True, text=True)
return sp.returncode == 0, sp.stderr
Type guard
def has_modern_clojure_cli() -> bool:
import subprocess
try:
return subprocess.run(["clojure", "-Spath"], capture_output=True, timeout=30).returncode == 0
except (OSError, subprocess.TimeoutExpired):
return False
Try / catch
try:
server = ClojureLSP(repo_path)
except RuntimeError as e:
if "-Spath" in str(e):
fix_clojure_cli_install() # upgrade CLI, clear ~/.clojure/.cpcache
server = ClojureLSP(repo_path)
else:
raise
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- `clojure` not found. Please install the official Clojure CLI
- Detected a Clojure executable, but it does not support '-Aal
- Download failed? Could not find clojure-lsp executable at {c
- Expected exactly one runtime dependency for platform-{Platfo
- Crystalline (Crystal language server) is not installed or no
AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29).
Data as JSON: /api/errors/30812074ffdcc417.
Report an issue: GitHub.