clojure-emacs/clj-refactor.el

Document (or remove) pkg-info dependency

Frozenlock opened this issue · 6 comments

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:

  • clojure-mode
  • cider
  • clj-refactor

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

Is it sound to add pkg-info to

;; Package-Requires: ((emacs "26.1") (seq "2.19") (yasnippet "0.6.1") (paredit "24") (multiple-cursors "1.2.2") (clojure-mode "5.14") (cider "1.3") (parseedn "1.0.6") (inflections "2.3") (hydra "0.13.2"))
?

cc/ @bbatsov

vemv commented

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

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

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.

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

Thanks!

Hope I can get this quickly fixed then.