clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.52k stars 643 forks source link

Unable to boot cider off a fresh corgi install? #3715

Closed shellandbull closed 3 weeks ago

shellandbull commented 3 weeks ago

Expected behavior

Invoking cider-jack-in-clj to boot a cider server

Actual behavior

The error Symbol’s value as variable is void: cider-clojure-cli-parameters happens. Here's what I see on screen on debug mode

Screenshot 2024-06-13 at 8 43 45 AM

Steps to reproduce the problem

Environment & Version information

1,7 GHz Quad-Core Intel Core i7

CIDER version information

CIDER 1.5.0-snapshot (package: 1.5.0-snapshot)

Lein / Clojure CLI version

Clojure CLI version 1.11.2.1446

Leiningen 2.11.2 on Java 21.0.2 OpenJDK 64-Bit Server VM

💡 my project uses deps.edn

Emacs version

GNU Emacs 29.3
Copyright (C) 2024 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Operating system

Macbook Sonoma 14.5

JDK distribution

openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
vemv commented 3 weeks ago

The variable was removed a few years ago

Removed cider-clojure-cli-parameters due to clojure-cli jack-in changes.

https://github.com/clojure-emacs/cider/blob/105da319b09a436552f1b3c6194cbbc833017dd2/CHANGELOG.md#110-2021-04-22

Feel free to continue the conversation - we'll be happy to assist.

shellandbull commented 3 weeks ago

@vemv thanks for the quick response! I guess a PR to corgi is somewhat overdue?

How can I fix this? the code fails exactly here

;; Most annoying JVM "feature" of all time
;; https://docs.cider.mx/cider/troubleshooting.html#empty-java-stacktraces
(defun corgi/around-cider-jack-in-global-options (command project-type)
  (if (eq 'clojure-cli project-type)
      (concat cider-clojure-cli-parameters
              " -J-XX:-OmitStackTraceInFastThrow")
    (funcall command project-type)))
bbatsov commented 3 weeks ago

Hmm, cider-clojure-cli-parameters still exists, so I'm a bit puzzled right now.

bbatsov commented 3 weeks ago
(defcustom cider-clojure-cli-parameters
  nil
  "Params passed to clojure cli to start an nREPL server via `cider-jack-in'."
  :type 'string
  :safe #'stringp
  :package-version '(cider . "1.8.0"))

What's your CIDER version?

vemv commented 3 weeks ago

Yes was looking at that, cider-clojure-cli-parameters was reintroduced in CIDER 1.8.0 🌀

bbatsov commented 3 weeks ago

Ah, seems the problem is the use of the ancient CIDER 1.5. An upgrade to a recent version will solve this.

vemv commented 3 weeks ago

corgi-packages depends on cider as of https://github.com/clojure-emacs/cider/commit/68974c9fb6ee6e95a4568c46a9c4371b24d2f0e9 which is definitely old

shellandbull commented 3 weeks ago

@vemv / @bbatsov thanks you both for being so quick - is it safe to say an upgrade to cider is long overdue?

EDIT: CIDER 1.5. is quoted as old but the most recent release is 1.14?? https://github.com/clojure-emacs/cider/releases/tag/v1.14.0

bbatsov commented 3 weeks ago

1.15

shellandbull commented 3 weeks ago
Screenshot 2024-06-13 at 12 20 58 PM

it was always 1.15

shellandbull commented 3 weeks ago

I reinstall the package and I can now boot a cider REPL

Syntax highlighting is gone and the error I get now is:

failed to define function cider--setup-menu-for-clojure-major-mode

vemv commented 3 weeks ago

Are you able to obtain a stacktrace?

You should by running M-x toggle-debug-on-error beforehand

shellandbull commented 3 weeks ago

Screenshot 2024-06-13 at 1 09 57 PM

It feels as if corgi needs some changes to accommodate new versions of cider? I only have about 2 weeks of experience with clojure so I'm finding this a bit hard to untangle

vemv commented 3 weeks ago

It looks like a good idea to bump clojure-mode as well - most likely it's old as well

After that, please quit emacs, remove all .elc file within your Emacs dir, retry

shellandbull commented 3 weeks ago

@vemv same error happens:

File mode specification error: (error Autoloading file /Users/xyzxyz/.emacs.corgi/straight/build/cider/cider-mode.elc failed to define function cider--setup-menu-for-clojure-major-mode) 

and in full:

Screenshot 2024-06-13 at 1 25 31 PM
shellandbull commented 3 weeks ago

https://github.com/clojure-emacs/cider/blob/105da319b09a436552f1b3c6194cbbc833017dd2/cider-mode.el#L552 the function seems to be real in this codebase

it looks like cider-mode succeeds when invoked

but invoking clojure-mode fails

vemv commented 3 weeks ago

If you're the first person to upgrade Corgi to use cider latest, you may be uncovering some sort of uncompatibility, IDK.

You may have luck asking about failed to define function errors in Clojurians Slack #emacs

shellandbull commented 3 weeks ago

@vemv I don't think I am specifying a newer version, I downloaded the software as-is. I might be luckier if I just ask other people with a non broken version of corgi what version of the packages they're using

vemv commented 3 weeks ago

Alright

btw although I sympathize with Corgi, if corgi-packages points at such old versions https://github.com/corgi-emacs/corgi-packages/blob/c0406ba6cf128e561b22e2c201801f8d59f8a66c/corgi-versions.el#L6 then it might be a hint that it's not as active as we'd wish.

I've had a good experience syncing changes with Doom folks

shellandbull commented 3 weeks ago

@vemv I started with spacemacs, it was too heavy and ate so much ram

I found corgi which seemed so much lighter and I was very happy with but it looks like every "flavour" of emacs has a different issue that requires manual fixing, to the point where I feel like giving up and just use python over clojure and a standard setup

vemv commented 3 weeks ago

Doom appears to have a focus on efficiency - I've heard good feedback from Clojure peers at workplaces or OSS teams, over the years.

Then there's @bbatsov's own Prelude, although less vim-y I think 😄

shellandbull commented 3 weeks ago

@vemv I know someone with corgi on their setup and its pretty fast/reusable. I'll ask them about versions and what not - could you please open an issue on corgi citing the stuff that needs updating? I'd do it myself but I can barely understand any of the code in this case

vemv commented 3 weeks ago

Sure, will cc/ you