emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.29k stars 275 forks source link

Emacs >= 29.1: "⛔ Warning (comp): evil-pkg.el:1:2: Warning: the function `define-package' is not known to be defined." #1915

Open jf opened 2 weeks ago

jf commented 2 weeks ago

Issue type

NOTE that this is, in a way, a bug report, but since it does not (at least not to me) result in any failure, I am classing it as "Other"

Environment

Emacs version: GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.2.0, Carbon Version 170 AppKit 2487.3) of 2024-04-10 Operating System: macOS Sonoma Evil version: Evil version 1.15.0 Evil installation type: straight.el Graphical/Terminal: graphical Tested in a make emacs session (see CONTRIBUTING.md): No

Reproduction steps

(straight-use-package 'evil) (evil-mode)


# Expected behavior
No warnings in \*Warnings\* 

# Actual behavior
I get a warning in \*Warnings\*:

⛔ Warning (comp): evil-pkg.el:1:2: Warning: the function `define-package' is not known to be defined."


# Further notes

To be sure, there are actually more warnings than the one mentioned; I'm unsure as to where the fault lies with the other 2. Please feel free to reply re the other 2. The complete list:

⛔ Warning (comp): /Users/jf/.config/emacs/straight/build/evil/evil-types.el: Error: Native elisp load failed /Users/jf/.config/emacs/eln-cache/29_1-31adefd2/subr--trampoline-7365742d77696e646f772d627566666572_set_window_buffer_0.eln ⛔ Warning (comp): evil-pkg.el:1:2: Warning: the function define-package' is not known to be defined. ⛔ Warning (comp): evil-states.el:166:23: Warning:goto-line' is for interactive use only; use `forward-line' instead.



I imagine for the warning about `define-package`, wrapping the call to `define-package` in a `version<` check would work (unless something else needs to be done in place of `define-package`?)
axelf4 commented 2 weeks ago

evil-pkg.el is not meant to be evaluated or compiled, package.el only reads it - I do not know why straight.el byte-compiles it for you. As the file gets regenerated by the ELPAs from the metadata in evil.el anyway it really should just be removed.

tomdl89 commented 2 weeks ago

Thanks for pointing out the goto-line comp warning though - I've fixed that in master just now.

jf commented 2 weeks ago

evil-pkg.el is not meant to be evaluated or compiled, package.el only reads it - I do not know why straight.el byte-compiles it for you. As the file gets regenerated by the ELPAs from the metadata in evil.el anyway it really should just be removed.

thank you for the info. Does this mean evil-pkg.el should be removed from the github repo?

tomdl89 commented 2 weeks ago

I don't know. @axelf4 feel free to remove it if you see fit 👍