{"record":{"id":"4c83ef047f474884","repo":"oraios/serena","slug":"detected-a-clojure-executable-but-it-does-not-sup","errorCode":null,"errorMessage":"Detected a Clojure executable, but it does not support '-Aaliases'.\nPlease install the official Clojure CLI from:\n  https://clojure.org/guides/getting_started","messagePattern":"Detected a Clojure executable, but it does not support '-Aaliases'\\.\nPlease install the official Clojure CLI from:\n  https://clojure\\.org/guides/getting_started","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/clojure_lsp.py","lineNumber":78,"sourceCode":"def run_command(cmd: list, capture_output: bool = True) -> subprocess.CompletedProcess:\n    return subprocess_run(\n        cmd,\n        capture_output=False,\n        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","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/clojure_lsp.py#L60-L96","documentation":"verify_clojure_cli raises RuntimeError when a `clojure` executable exists on PATH but its `--help` output does not advertise '-Aaliases', indicating it is not a functional official Clojure CLI (wrong shim, ancient CLI, or a lookalike binary). The library uses this probe to validate the CLI before relying on `clojure -Spath`.","triggerScenarios":"Calling verify_clojure_cli when shutil.which('clojure') finds a binary, but the output of `clojure --help` lacks the '-Aaliases' string — i.e. the binary does not behave like the official Clojure CLI.","commonSituations":"A shim/wrapper named `clojure` that forwards elsewhere (e.g. a Babashka or clj-style wrapper); very old Clojure CLI predating the expected interface; a stub script on PATH shadowing the real CLI; conda/nix environment providing a different clojure binary.","solutions":["Inspect `which clojure` and `clojure --help` to identify what binary is shadowing the real CLI","Remove or rename the offending shim and install the official Clojure CLI from https://clojure.org/guides/getting_started","Reorder PATH so the official CLI's bin directory takes precedence, then verify `clojure --help` mentions -Aaliases","Upgrade the Clojure CLI if it is very old (older CLIs may lack the probed interface)"],"exampleFix":"// before\n$ which clojure\n/home/user/bin/clojure  # a shim\n// after\nrm /home/user/bin/clojure\nexport PATH=/usr/local/bin:$PATH  # official CLI first\nclojure --help  # shows -Aaliases","handlingStrategy":"validation","validationCode":"import shutil, subprocess\nif shutil.which(\"clojure\"):\n    out = subprocess.run([\"clojure\", \"--help\"], capture_output=True, text=True).stdout\n    if \"-Aaliases\" not in out:\n        print(\"'clojure' on PATH is not the official CLI; remove the shim and install the official Clojure CLI\")","typeGuard":null,"tryCatchPattern":"try:\n    server = ClojureLSP(...)\nexcept RuntimeError as e:\n    if \"does not support '-Aaliases'\" in str(e):\n        raise SystemExit(\"Replace the non-standard 'clojure' binary on PATH with the official Clojure CLI\")\n    raise","preventionTips":["Avoid shims or wrappers named `clojure` that shadow the official CLI","Keep the Clojure CLI up to date (very old CLIs may fail the probe)","Check `which clojure` when using conda/nix environments that provide lookalike binaries"],"tags":["clojure","cli","version","path","validation"],"backgroundTag":"required-executable-not-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}