purcell / package-lint

A linting library for elisp package metadata
GNU General Public License v3.0
195 stars 34 forks source link

False positive jsonrpc dependency error for Emacs < 27.1 #202

Closed juergenhoetzel closed 3 years ago

juergenhoetzel commented 3 years ago

jsonrpc is a (transitive) dependency of eglot and also available for older Emacen via elpa:

fsharp-mode Dependency-Tree for 26.3:

fsharp-mode 1.9.15
    s 1.3.1    [1.12.0 installed]
    eglot (any)    [1.7 installed]
        jsonrpc 1.0.14

package-lint still reports an error

eglot-fsharp.el:157:9: error: You should depend on (emacs "27.1") if you need `jsonrpc-error'.

@riscy https://github.com/fsharp/emacs-fsharp-mode/pull/260#issuecomment-761078162

purcell commented 3 years ago

I think the problem here is relying on a transitive dependency. If you use a package directly, you should declare a dependency on it. eglot could theoretically drop its jsonrpc dependency at any time.

juergenhoetzel commented 3 years ago

I think the problem here is relying on a transitive dependency. If you use a package directly, you should declare a dependency on it. eglot could theoretically drop its jsonrpc dependency at any time

You are right about the fact that I should list this as an explicit dependency because I use internals.

Unfortunately the explicit dependency ;; Package-Requires: ((emacs "26.3") (eglot "1.4") (fsharp-mode "1.10") (jsonrpc "1.0.14")) doesn't fix the error.

purcell commented 3 years ago

Ah! package-lint didn't know that a backport of jsonrpc was available in ELPA. Fixed in 71b12f7.

juergenhoetzel commented 3 years ago

I can confirm this fixed the issue :+1:

purcell commented 3 years ago

Great, thanks for confirming that.