clojure-emacs / clj-refactor.el

A CIDER extension that provides powerful commands for refactoring Clojure code.
GNU General Public License v3.0
771 stars 111 forks source link

Document (or remove) pkg-info dependency #517

Closed Frozenlock closed 1 year ago

Frozenlock commented 2 years ago

Expected behavior

Cider connects as usual.

Actual behavior

[nREPL] Establishing direct connection to localhost:7002 ...
[nREPL] Direct connection to localhost:7002 established
error in process filter: cljr--version: Symbol’s function definition is void: pkg-info-version-info
error in process filter: Symbol’s function definition is void: pkg-info-version-info

This error goes away if pkg-info is installed.

Steps to reproduce the problem

With a fresh Emacs install, use-package the following:

Add a hook to start clj-refactor-mode with automatically with clojure-mode.

M-x cider-connect

Environment & Version information

clj-refactor.el version information

clj-refactor 3.5.2 (package: 20220315.2251), refactor-nrepl 3.1.0

CIDER version information

;; CIDER 1.4.0 (Kyiv), nREPL 0.8.0
;; Clojure 1.10.1, Java 17.0.2

Leiningen or Boot version

Leiningen 2.9.8 on Java 17.0.2 OpenJDK 64-Bit Server VM

Emacs version

GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-05-09

Operating system

Ubuntu 18.04.6 LTS

vemv commented 2 years ago

Is it sound to add pkg-info to https://github.com/clojure-emacs/clj-refactor.el/blob/f368c56c83843396b160440f472a661a3b639862/clj-refactor.el#L13 ?

cc/ @bbatsov

vemv commented 2 years ago

Taking a look, pkg-info looks like a vanilla package that would be safe to depend on, like any other package.

https://melpa.org/#/pkg-info

bbatsov commented 2 years ago

pgk-info has been long abandoned, that's why I've removed it it a while ago from most of my projects. It still works, though, but I dislike the dependency it has to the massive epl package, which has also been abandoned for a long time. I guess the breakage here happened when I removed pkg-info from CIDER and I'd suggest to use in clj-refactor.el the same version extracting logic I've introduced in CIDER instead of restoring the pkg-info dep.

vemv commented 2 years ago

SGTM, thanks for the insight!

Is the version logic working nicely in cider? I do remember some headscratching issues that had the build failing for a while.

If it happened to be still hacky, perhaps we could try to solve the problem again from scratch, assuming we came up with something radically simpler.

bbatsov commented 2 years ago

Yeah, all the problems with CIDER's solution have been addressed. You also have to keep in mind that pkg-info is not on GNU ELPA, which was my primary motivation to remove it. We can't have such deps for packages on ELPA.

vemv commented 2 years ago

Thanks!

Hope I can get this quickly fixed then.