Fork me on GitHub
#spacemacs
<
2022-01-02
>
Akku Ankka07:01:52

i'm trying to get a clj/spacemacs set up going, and I think my install is broken somehow. helm-cider tries to load a feature from cider cider-compat, which seems to have been removed from cider itself. i checked helm-cider on gh and the (require 'cider-compat) is still in the codebase? whaddoido‽ any help or ideas are much appreciated.

Akku Ankka07:01:32

also my isn't starting which i assume is related because the cider-compat bug happens on buffer load.

practicalli-johnny09:01:55

@cwmckenzie02 I haven't seen this issue before. If installing Spacemacs for the first time, there is not much to go wrong (except packages failing to download). Adding Clojure only needs clojure added to the layer list Assuming Emacs was restarted after all the initial packages were downloaded, I would delete all the cider packages from /.emacs.d/elpa/ directory tree (or the /.emacs.d/elpa/ directory itself if there is a fast internet connection) and restart Emacs Here is a general troubleshooting guide https://practical.li/spacemacs/install-spacemacs/troubleshooting.html

practicalli-johnny09:01:27

I assume that Java and Clojure (Clojure CLI or Leiningen) have already been installed and tested they work https://practical.li/spacemacs/before-you-start/

practicalli-johnny10:01:14

@cwmckenzie02 it seems like there is a bug with helm cider. It's relying on a piece of code that no longer exists. https://clojurians.slack.com/archives/C0617A8PQ/p1641081555031900

Akku Ankka12:01:02

i did update stuff today, but i remember seeing that the file was removed a while ago. i'll have a look at git blame and see when the file was removed maybe?

practicalli-johnny12:01:49

For anyone updating packages from the 29th December onward, there is a bug in the helm-cider package caused by a change in cider. Cider has dropped the cider-compat namespace which helm-cider requires (unneccessarily), preventing Emacs from loading Clojure files correctly. I've https://github.com/clojure-emacs/helm-cider/issues/12 Options for a temporary fix 1. Edit ~/.emacs.d/elpa/27.1/develop/helm-cider-20180307.458/helm-cider-spec.el and comment line 16 that says (require 'cider-compat) or just delete that line. The package hasnt changed for several years, so this should only need to be done once 2. Pin cider to an earlier version (or use a back up from before 29th December) by adding the following to dotspacemacs/additional-packages - you will need to delete the package cider-20220102.936 clojure-mode-20211119.1904 and cider-eval-sexp-fu-20190311.2152 from ~/.emacs.d/elpa/ and comment out cider or (cider ,,,) from the layer list (as that will automatically download the latest version)

(cider :location
   (recipe :fetcher github
           :repo "clojure-emacs/cider"
           :commit "ae376429a8cf22b82a9e18ff844bdfbe5fc7ecc1"))
Restart and the pinned version of Cider will be installed. If you have clojure variables set in the layer list, then you can uncomment them and restart for those to take effect (this will not update the package, that will only be done if using SPC f e U )

practicalli-johnny17:01:58

The helm-cider package has been updated to remove the issue and its package is available on Melpa - so it will be included in the Spacemacs package update, SPC f e U Thanks to Bozhidar for a speedy response.

Akku Ankka12:01:18

ya i just saw that

practicalli-johnny12:01:26

Simplest thing seems to be to remove the line from the helm-cider package. I'll raise a PR and see if that gets accepted

practicalli-johnny12:01:41

on the helm-cider repository

Akku Ankka12:01:21

yep that works

Akku Ankka12:01:59

and it did pull down the lsp binary once that was out of the way

Akku Ankka12:01:11

thanks again!

practicalli-johnny12:01:08

I've set some of these options in the dotspacemacs-configuration-layers section

(lsp :variables
          ;; Formatting and indentation
          lsp-enable-on-type-formatting t
          ;; Set to nil to use CIDER features instead of LSP UI
          lsp-enable-indentation t
          lsp-enable-snippet t

          ;; `lsp-toggle-symbol-highlight` toggles highlighting
          ;; subtle highlighting for doom-gruvbox-light theme defined in dotspacemacs/user-config
          lsp-enable-symbol-highlighting t

          ;; Show lint error indicator in the mode line
          ;; lsp-modeline-diagnostics-enable t           ;; default
          ;; lsp-modeline-diagnostics-scope ':workspace  ;; default

          ;; popup documentation boxes
          lsp-ui-doc-enable t               ;; documentation popups
          lsp-ui-doc-show-with-cursor nil   ;; doc popup triggered by cursor
          lsp-ui-doc-show-with-mouse nil    ;; doc popup triggered by mouse
          lsp-ui-doc-delay 1                ;; delay in seconds for popup to display
          lsp-ui-doc-include-signature t    ;; include function signature
          ;; lsp-ui-doc-position 'at-point  ;; top bottom at-point
          ;; lsp-ui-doc-alignment 'window      ;; frame window

          ;; code actions and diagnostics text as right-hand side of buffer
          ;; disabling this feature only works in dotspacemacs/user-config
          lsp-ui-sideline-enable nil
          lsp-ui-sideline-show-code-actions nil
          ;; lsp-ui-sideline-delay 500
          ;; lsp-ui-sideline-show-diagnostics nil

          ;; function reference count and test coverage
          lsp-lens-enable t

          ;; Efficient use of space in treemacs-lsp display
          treemacs-space-between-root-nodes nil

          ;; Optimization for large files
          lsp-file-watch-threshold 10000
          lsp-log-io nil)

practicalli-johnny17:01:58
replied to a thread:For anyone updating packages from the 29th December onward, there is a bug in the helm-cider package caused by a change in cider. Cider has dropped the cider-compat namespace which helm-cider requires (unneccessarily), preventing Emacs from loading Clojure files correctly. I've https://github.com/clojure-emacs/helm-cider/issues/12 Options for a temporary fix 1. Edit `~/.emacs.d/elpa/27.1/develop/helm-cider-20180307.458/helm-cider-spec.el` and comment line 16 that says `(require 'cider-compat)` or just delete that line. The package hasnt changed for several years, so this should only need to be done once 2. Pin cider to an earlier version (or use a back up from before 29th December) by adding the following to `dotspacemacs/additional-packages` - you will need to delete the package `cider-20220102.936` `clojure-mode-20211119.1904` and `cider-eval-sexp-fu-20190311.2152` from `~/.emacs.d/elpa/` and comment out cider or (cider ,,,) from the layer list (as that will automatically download the latest version) (cider :location (recipe :fetcher github :repo "clojure-emacs/cider" :commit "ae376429a8cf22b82a9e18ff844bdfbe5fc7ecc1")) Restart and the pinned version of Cider will be installed. If you have clojure variables set in the layer list, then you can uncomment them and restart for those to take effect (this will not update the package, that will only be done if using `SPC f e U` )

The helm-cider package has been updated to remove the issue and its package is available on Melpa - so it will be included in the Spacemacs package update, SPC f e U Thanks to Bozhidar for a speedy response.