branch: elpa/cider commit d6a875bd530a5727e032fa3edcab6d4980a55fb4 Author: Oleksandr Yakushev <a...@bytopia.org> Commit: Bozhidar Batsov <bozhi...@batsov.dev>
Remove Boot support --- CHANGELOG.md | 1 + README.md | 8 +-- cider.el | 65 +++------------------- doc/modules/ROOT/pages/basics/installation.adoc | 6 +- doc/modules/ROOT/pages/cljs/other_repls.adoc | 39 ------------- doc/modules/ROOT/pages/cljs/up_and_running.adoc | 15 +---- doc/modules/ROOT/pages/troubleshooting.adoc | 11 ++-- doc/modules/ROOT/pages/usage/code_completion.adoc | 6 +- test/cider-tests.el | 67 +---------------------- 9 files changed, 25 insertions(+), 193 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d93728fa49..46d423f8b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Changes - [#3782](https://github.com/clojure-emacs/cider/issues/3782): **(Breaking)** Drop official support for Emacs 26. +- [#3812](https://github.com/clojure-emacs/cider/issues/3812): **(Breaking)** Remove support for Boot. - [#3793](https://github.com/clojure-emacs/cider/issues/3793): **(Breaking)** Remove features that relied on printed exception parsing: - `cider-stacktrace-analyze-string` and `cider-stacktrace-analyze-at-point` functions. - Automatic stacktrace parsing in log viewer. diff --git a/README.md b/README.md index 93ad5d1e84..83ecd907cf 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ install CIDER with the following command: ### Launch an nREPL server and client from Emacs -Simply open in Emacs a file belonging to your `lein`, `tools.deps` or `boot` project (like +Simply open in Emacs a file belonging to your `lein` or `tools.deps` project (like `foo.clj`) and type <kbd>M-x</kbd> `cider-jack-in`. This will start an nREPL server with all the project dependencies loaded in and CIDER will automatically connect to it. @@ -82,12 +82,6 @@ You can go to your project's directory in a terminal and type there $ lein repl ``` -Or with Boot: - -``` -$ boot repl -s wait -``` - Alternatively you can start nREPL either manually or by the facilities provided by your project's build tool (`tools.deps`, Gradle, Maven, etc). diff --git a/cider.el b/cider.el index 3a3d5e2848..9f79b33a1f 100644 --- a/cider.el +++ b/cider.el @@ -289,7 +289,9 @@ By default we favor the project-specific shadow-cljs over the system-wide." :package-version '(cider . "1.14.0")) (make-obsolete-variable 'cider-lein-global-options 'cider-lein-parameters "1.8.0") -(make-obsolete-variable 'cider-boot-global-options 'cider-boot-parameters "1.8.0") +(make-obsolete-variable 'cider-boot-command nil "1.8.0") +(make-obsolete-variable 'cider-boot-parameters nil "1.8.0") +(make-obsolete-variable 'cider-boot-global-options nil "1.8.0") (make-obsolete-variable 'cider-clojure-cli-global-options 'cider-clojure-cli-parameters "1.8.0") (make-obsolete-variable 'cider-shadow-cljs-global-options 'cider-shadow-cljs-parameters "1.8.0") (make-obsolete-variable 'cider-gradle-global-options 'cider-gradle-parameters "1.8.0") @@ -300,7 +302,7 @@ By default we favor the project-specific shadow-cljs over the system-wide." (if (executable-find "clojure") 'clojure-cli 'lein) "The default tool to use when doing `cider-jack-in' outside a project. This value will only be consulted when no identifying file types, i.e. -project.clj for leiningen or build.boot for boot, could be found. +project.clj for leiningen or deps.edn for clojure-cli, could be found. As the Clojure CLI is bundled with Clojure itself, it's the default. In the absence of the Clojure CLI (e.g. on Windows), we fallback @@ -320,7 +322,7 @@ to Leiningen." nil "Allow choosing a build system when there are many. When there are project markers from multiple build systems (e.g. lein and -boot) the user is prompted to select one of them. When non-nil, this +clojure-cli) the user is prompted to select one of them. When non-nil, this variable will suppress this behavior and will select whatever build system is indicated by the variable if present. Note, this is only when CIDER cannot decide which of many build systems to use and will never override a @@ -432,7 +434,6 @@ The plist supports the following keys "Determine the command `cider-jack-in' needs to invoke for the PROJECT-TYPE." (pcase project-type ('lein cider-lein-command) - ('boot cider-boot-command) ('clojure-cli cider-clojure-cli-command) ('babashka cider-babashka-command) ('shadow-cljs cider-shadow-cljs-command) @@ -477,7 +478,6 @@ Throws an error if PROJECT-TYPE is unknown." " " r) r))) - ('boot (cider--resolve-command cider-boot-command)) ('clojure-cli (if (and cider-enrich-classpath (not (eq system-type 'windows-nt)) (executable-find (cider--get-enrich-classpath-clojure-cli-script))) @@ -510,7 +510,6 @@ Throws an error if PROJECT-TYPE is unknown." "Determine the command line options for `cider-jack-in' for the PROJECT-TYPE." (pcase project-type ('lein cider-lein-global-options) - ('boot cider-boot-global-options) ('clojure-cli cider-clojure-cli-global-options) ('babashka cider-babashka-global-options) ('shadow-cljs cider-shadow-cljs-global-options) @@ -527,7 +526,6 @@ Throws an error if PROJECT-TYPE is unknown." ;; Please be careful when changing them. (pcase project-type ('lein cider-lein-parameters) - ('boot cider-boot-parameters) ('clojure-cli cider-clojure-cli-parameters) ('babashka cider-babashka-parameters) ('shadow-cljs cider-shadow-cljs-parameters) @@ -545,7 +543,7 @@ Throws an error if PROJECT-TYPE is unknown." (defcustom cider-injected-nrepl-version "1.3.1" "The version of nREPL injected on jack-in. We inject the newest known version of nREPL just in case -your version of Boot or Leiningen is bundling an older one." +your version of Leiningen is bundling an older one." :type 'string :package-version '(cider . "1.2.0") :safe #'stringp) @@ -692,12 +690,6 @@ returned by this function only contains strings." (car spec) spec))))) -(defun cider--list-as-boot-artifact (list) - "Return a boot artifact string described by the elements of LIST. -LIST should have the form (ARTIFACT-NAME ARTIFACT-VERSION). The returned -string is quoted for passing as argument to an inferior shell." - (concat "-d " (shell-quote-argument (format "%s:%s" (car list) (cadr list))))) - (defun cider--jack-in-required-dependencies () "Returns the required CIDER deps. They are normally added to `cider-jack-in-dependencies', @@ -705,32 +697,6 @@ unless it's a Lein project." `(("nrepl/nrepl" ,cider-injected-nrepl-version) ("cider/cider-nrepl" ,cider-injected-middleware-version))) -(defun cider-boot-dependencies (dependencies) - "Return a list of boot artifact strings created from DEPENDENCIES." - (concat (mapconcat #'cider--list-as-boot-artifact dependencies " ") - (unless (seq-empty-p dependencies) " "))) - -(defun cider-boot-middleware-task (params middlewares) - "Create a command to add MIDDLEWARES with corresponding PARAMS." - (concat "cider.tasks/add-middleware " - (mapconcat (lambda (middleware) - (format "-m %s" (shell-quote-argument middleware))) - middlewares - " ") - " " params)) - -(defun cider-boot-jack-in-dependencies (global-opts params dependencies middlewares) - "Create boot jack-in dependencies. -Does so by concatenating GLOBAL-OPTS, DEPENDENCIES, -and MIDDLEWARES. PARAMS and MIDDLEWARES are passed on to -`cider-boot-middleware-task` before concatenating and DEPENDENCIES - are passed on to `cider-boot-dependencies`." - (concat global-opts - (unless (seq-empty-p global-opts) " ") - "-i \"(require 'cider.tasks)\" " ;; Note the space at the end here - (cider-boot-dependencies (append (cider--jack-in-required-dependencies) dependencies)) - (cider-boot-middleware-task params middlewares))) - (defun cider--gradle-dependency-notation (dependency) "Returns Gradle's GAV dependency syntax. For a \"group/artifact\" \"version\") DEPENDENCY list @@ -959,8 +925,8 @@ See also `cider-jack-in-auto-inject-clojure'." These are set in `cider-jack-in-dependencies', `cider-jack-in-lein-plugins' and `cider-jack-in-nrepl-middlewares' are injected from the CLI according to the used PROJECT-TYPE, and COMMAND if provided. Eliminates the need for -hacking profiles.clj or the boot script for supporting CIDER with its nREPL -middleware and dependencies." +hacking profiles.clj for supporting CIDER with its nREPL middleware and +dependencies." (pcase project-type ('lein (cider-lein-jack-in-dependencies global-opts @@ -970,12 +936,6 @@ middleware and dependencies." cider-jack-in-dependencies-exclusions (cider-jack-in-normalized-lein-plugins) cider-jack-in-lein-middlewares)) - ('boot (cider-boot-jack-in-dependencies - global-opts - params - (cider-add-clojure-dependencies-maybe - cider-jack-in-dependencies) - (cider-jack-in-normalized-nrepl-middlewares))) ('clojure-cli (cider-clojure-cli-jack-in-dependencies global-opts params @@ -1057,12 +1017,6 @@ Generally you should not disable this unless you run into some faulty check." (unless (cider-library-present-p "weasel.repl.server") (user-error "Weasel in not available. Please check https://docs.cider.mx/cider/basics/clojurescript/#browser-connected-clojurescript-repl for details"))) -(defun cider-check-boot-requirements () - "Check whether we can start a Boot ClojureScript REPL." - (cider-verify-piggieback-is-present) - (unless (cider-library-present-p "adzerk.boot-cljs-repl") - (user-error "The Boot ClojureScript REPL is not available. Please check https://github.com/adzerk-oss/boot-cljs-repl/blob/master/README.md for details"))) - (defun cider-check-krell-requirements () "Check whether we can start a Krell ClojureScript REPL." (cider-verify-piggieback-is-present) @@ -1223,8 +1177,6 @@ The supplied string will be wrapped in a do form if needed." cider-check-node-requirements) (weasel "(do (require 'weasel.repl.websocket) (cider.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \"127.0.0.1\" :port 9001)))" cider-check-weasel-requirements) - (boot "(do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))" - cider-check-boot-requirements) (shadow cider-shadow-cljs-init-form cider-check-shadow-cljs-requirements) (shadow-select cider-shadow-select-cljs-init-form cider-check-shadow-cljs-requirements) (krell "(require '[clojure.edn :as edn] @@ -2072,7 +2024,6 @@ Search for lein or java processes including nrepl.command nREPL." PROJECT-DIR defaults to current project." (let* ((default-directory (or project-dir (clojure-project-dir (cider-current-dir)))) (build-files '((lein . "project.clj") - (boot . "build.boot") (clojure-cli . "deps.edn") (babashka . "bb.edn") (shadow-cljs . "shadow-cljs.edn") diff --git a/doc/modules/ROOT/pages/basics/installation.adoc b/doc/modules/ROOT/pages/basics/installation.adoc index e35fefb815..bcac315678 100644 --- a/doc/modules/ROOT/pages/basics/installation.adoc +++ b/doc/modules/ROOT/pages/basics/installation.adoc @@ -16,9 +16,9 @@ CIDER officially supports Emacs 27.1+, Java 8+, and Clojure(Script) 1.10+. If you need to work with earlier versions, check xref:about/compatibility.adoc#compatibility-matrix[compatibility matrix]. -You'll also need a recent version of either the Clojure CLI tools or your -favorite build tool (Leiningen, Boot, or Gradle) to be able to start CIDER via -`cider-jack-in`. Generally it's a good idea to use the latest stable versions. +You'll also need a recent version of your favorite build tool (Clojure CLI, +Leiningen, or Gradle) to be able to start CIDER via `cider-jack-in`. Generally +it's a good idea to use the latest stable versions. == Installation via package.el diff --git a/doc/modules/ROOT/pages/cljs/other_repls.adoc b/doc/modules/ROOT/pages/cljs/other_repls.adoc index 010a922f47..b954b80de3 100644 --- a/doc/modules/ROOT/pages/cljs/other_repls.adoc +++ b/doc/modules/ROOT/pages/cljs/other_repls.adoc @@ -48,45 +48,6 @@ documentation lookup, the namespace browser, and macroexpansion). TIP: For more information on Weasel you should consult its https://github.com/nrepl/weasel/blob/master/README.md[documentation]. -== Boot ClojureScript REPL - -`boot-cljs` is another browser-connected ClojureScript REPL, that's targeting the Boot build tool. -Internally, it's powered by Weasel. Let's go over the steps required to use it. - -. Add this to your dependencies in `build.boot`: -+ -[source,clojure] ----- -[adzerk/boot-cljs "X.Y.Z" :scope "test"] -[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"] -[pandeiro/boot-http "X.Y.Z" :scope "test"] -[weasel "0.7.1" :scope "test"] -[cider/piggieback "0.5.3" :scope "test"] ; not needed for cider-jack-in-cljs ----- -+ -and this at the end of `build.boot`: -+ -[source,clojure] ----- -(require - '[adzerk.boot-cljs :refer [cljs]] - '[adzerk.boot-cljs-repl :refer [cljs-repl]] - '[pandeiro.boot-http :refer [serve]]) - -(deftask dev [] - (comp (serve) - (watch) - (cljs-repl) ; order is important!! - (cljs))) ----- -+ -. Type kbd:[M-x] `customize-variable` kbd:[RET] `cider-boot-parameters` -and insert `dev`. -. Open a file in your project and type kbd:[M-x] `cider-jack-in-cljs`. -. Connect to the running server with your browser. The address is printed on the terminal, but it's probably `+http://localhost:3000+`. - -For more information visit https://github.com/adzerk-oss/boot-cljs-repl[boot-cljs-repl]. - == nbb (node.js babashka) CIDER has built-in support for `nbb`. You can either jack in to an nbb project with `M-x clojure-jack-in-cljs`. diff --git a/doc/modules/ROOT/pages/cljs/up_and_running.adoc b/doc/modules/ROOT/pages/cljs/up_and_running.adoc index a1e6f442e9..fe90cb427a 100644 --- a/doc/modules/ROOT/pages/cljs/up_and_running.adoc +++ b/doc/modules/ROOT/pages/cljs/up_and_running.adoc @@ -19,14 +19,13 @@ to connect to an already running nREPL server using === Manual Piggieback Setup To setup piggieback, add the following dependencies to your project -(`project.clj` in a Leiningen based project or `build.boot` in a Boot -project or `deps.edn`): +(`project.clj` or `deps.edn`): [source,clojure] ---- ;; use whatever are the most recent versions here -[cider/piggieback "0.5.3"] -[org.clojure/clojure "1.11.1"] +[cider/piggieback "0.6.0"] +[org.clojure/clojure "1.12.0"] ---- as well as `piggieback` nREPL middleware: @@ -38,14 +37,6 @@ in `project.clj`: :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]} ---- -or in `build.boot`: - -[source,clojure] ----- -(task-options! - repl {:middleware '[cider.piggieback/wrap-cljs-repl]}) ----- - or in `deps.edn`: [source,clojure] diff --git a/doc/modules/ROOT/pages/troubleshooting.adoc b/doc/modules/ROOT/pages/troubleshooting.adoc index 803a24bb3d..11271457a7 100644 --- a/doc/modules/ROOT/pages/troubleshooting.adoc +++ b/doc/modules/ROOT/pages/troubleshooting.adoc @@ -161,8 +161,8 @@ least what's being required). === Warning saying you have to use newer nREPL -CIDER currently requires at least nREPL 0.6 to work properly. As nREPL comes -bundled with Leiningen and Boot, from time to time you might have to override the +CIDER currently requires at least nREPL 1.0 to work properly. As nREPL comes +bundled with Leiningen, from time to time you might have to override the version supplied by them (e.g. if you're forced to use an older version of Leiningen or there's no release bundling the required nREPL version yet). Leiningen users can add this to their `profiles.clj` to force the proper dependency: @@ -172,8 +172,6 @@ users can add this to their `profiles.clj` to force the proper dependency: {:repl {:dependencies [[nrepl/nrepl "x.y.z"]]}} ---- -The procedure is pretty similar for Boot. - IMPORTANT: Make sure you add the newer nREPL dependency to the `:dependencies` key instead of `:plugins` (where the `cider-nrepl` Lein plugin resides). That's a pretty common mistake. @@ -230,7 +228,6 @@ in the "Middleware Setup" section. * Do `C-h v cider-inject-dependencies-at-jack-in`, and check that this variable is non-nil. * Make sure your project depends on at least Clojure `1.7.0`. * If you use Leiningen, make sure your `lein --version` is at least `2.9.0`. -* If you use Boot and you've changed `cider-boot-parameters`, that's probably the cause. If the above doesn't work, you can try specifying the cider-nrepl middleware manually, as per the @@ -242,8 +239,8 @@ in the "Middleware Setup" section. This means you're manually adding the cider-nrepl middleware in your project, but you shouldn't do that because `cider-jack-in` already does that for you. Look into the following files, and ensure you've removed all references to -`cider-nrepl` and `nrepl`: `project.clj`, `build.boot`, -`~/.lein/profiles.clj` and `~/.boot/profile.boot`. +`cider-nrepl` and `nrepl`: `project.clj`, `deps.edn`, +`~/.lein/profiles.clj` and `~/.clojure/deps.edn`. === I get some error related to refactor-nrepl on startup diff --git a/doc/modules/ROOT/pages/usage/code_completion.adoc b/doc/modules/ROOT/pages/usage/code_completion.adoc index 68d8379bde..43e97ae571 100644 --- a/doc/modules/ROOT/pages/usage/code_completion.adoc +++ b/doc/modules/ROOT/pages/usage/code_completion.adoc @@ -198,9 +198,9 @@ keys to cancel the prompt by customizing: Sometimes, the completion fails to recognize new classes that came with dependencies that were loaded dynamically after the REPL was started (e.g. via -Boot). Executing `M-x cider-completion-flush-caches` (or going through the menu -`+CIDER Interaction->Misc->Flush completion cache+`) forces the completion backend -to re-read all classes it can find on the classpath. +Clojure 1.12 `add-lib`). Executing `M-x cider-completion-flush-caches` (or going +through the menu `+CIDER Interaction->Misc->Flush completion cache+`) forces the +completion backend to re-read all classes it can find on the classpath. == Implementation Details diff --git a/test/cider-tests.el b/test/cider-tests.el index f03a7ba00d..655ffc6ab5 100644 --- a/test/cider-tests.el +++ b/test/cider-tests.el @@ -189,19 +189,6 @@ " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware" " -- repl :headless"))) - (it "can inject dependencies in a boot project" - (expect (cider-inject-jack-in-dependencies "" "repl -s wait" 'boot) - :to-equal (concat - "-i \"(require 'cider.tasks)\"" - " -d " - (shell-quote-argument "nrepl/nrepl:0.9.0") - " -d " - (shell-quote-argument "cider/cider-nrepl:0.55.1") - " cider.tasks/add-middleware" - " -m " - (shell-quote-argument "cider.nrepl/cider-middleware") - " repl -s wait"))) - (it "can inject dependencies in a gradle project" (expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle) :to-equal (concat "--no-daemon " @@ -228,24 +215,7 @@ (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware" - " -- repl :headless"))) - - (it "can inject dependencies in a boot project" - (setq-local cider-jack-in-dependencies '(("refactor-nrepl" "2.0.0"))) - (expect (cider-inject-jack-in-dependencies "" "repl -s wait" 'boot) - :to-equal (concat "-i \"(require 'cider.tasks)\"" - " -d " - (shell-quote-argument "nrepl/nrepl:0.9.0") - " -d " - (shell-quote-argument "cider/cider-nrepl:0.55.1") - " -d " - (shell-quote-argument "refactor-nrepl:2.0.0") - " cider.tasks/add-middleware" - " -m " - (shell-quote-argument "refactor-nrepl.middleware/wrap-refactor") - " -m " - (shell-quote-argument "cider.nrepl/cider-middleware") - " repl -s wait")))) + " -- repl :headless")))) (describe "when there are global options" (before-each @@ -265,17 +235,6 @@ " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware" " -- repl :headless"))) - (it "can concat in a boot project" - (expect (cider-inject-jack-in-dependencies "-C -o" "repl -s wait" 'boot) - :to-equal (concat "-C -o -i \"(require 'cider.tasks)\"" - " -d " - (shell-quote-argument "nrepl/nrepl:0.9.0") - " -d " - (shell-quote-argument "cider/cider-nrepl:0.55.1") - " cider.tasks/add-middleware" - " -m " - (shell-quote-argument "cider.nrepl/cider-middleware") - " repl -s wait"))) (it "can concat in a gradle project" (expect (cider-inject-jack-in-dependencies "--no-daemon" ":clojureRepl" 'gradle) :to-equal (concat "--no-daemon " @@ -347,29 +306,7 @@ (shell-quote-argument "[mx.cider/lein-enrich-classpath \"1.19.3\"]") " -- update-in :jvm-opts conj '\"-Djdk.attach.allowAttachSelf\"'" " -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware" - " -- repl :headless")))) - - (describe "when the middleware lists have been normalized (Boot)" - (before-each - (spy-on 'cider-jack-in-normalized-nrepl-middlewares - :and-return-value '("refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware")) - (setq-local cider-jack-in-dependencies '(("refactor-nrepl" "2.0.0"))) - (setq-local cider-jack-in-dependencies-exclusions '())) - (it "uses them in a boot project" - (expect (cider-inject-jack-in-dependencies "" "repl -s wait" 'boot) - :to-equal (concat "-i \"(require 'cider.tasks)\"" - " -d " - (shell-quote-argument "nrepl/nrepl:0.9.0") - " -d " - (shell-quote-argument "cider/cider-nrepl:0.55.1") - " -d " - (shell-quote-argument "refactor-nrepl:2.0.0") - " cider.tasks/add-middleware" - " -m " - (shell-quote-argument "refactor-nrepl.middleware/wrap-refactor") - " -m " - (shell-quote-argument "cider.nrepl/cider-middleware") - " repl -s wait"))))) + " -- repl :headless"))))) (describe "cider-jack-in-auto-inject-clojure" (it "injects `cider-minimum-clojure-version' when `cider-jack-in-auto-inject-clojure' is set to minimal"