emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
229 stars 17 forks source link

Eldev does not recognize define-package #17

Closed mithrandi closed 4 years ago

mithrandi commented 4 years ago

I'm not sure if this is actually an Eldev bug or if I'm just confused about Emacs packaging.

When I try to run Eldev, it (or actually package.el I think?) complains:

No .el files with package headers in ‘…cwd…’

In fact there are no package headers, but there is a -pkg.el with a define-package form; this is what the other packages I've looked at do, and straight.el is happy to load it.

doublep commented 4 years ago

When I try to run Eldev, it (or actually package.el I think?) complains

It is package.el, but Eldev incorporates a collection of workarounds already, so that each next project doesn't have to. Can add another one.

No .el files with package headers in ‘…cwd…’

In fact there are no package headers, but there is a -pkg.el with a define-package form

I would need the file. Eldev's test suite already includes such a project with -pkg.el and it does work fine in it.

mithrandi commented 4 years ago

Repo is here: https://github.com/mithrandi/debian-devel-el/tree/142dbb715e17470e1d20cce4f7d6d4128a020c90

doublep commented 4 years ago

It fails here:

(let* ((desc-file (package--description-file default-directory)))
  (if (file-readable-p desc-file)

Because directory name is debian-devel-el, it expects description in file named debian-devel-el-pkg.el. Does anything else handle this correctly (this name-building is buried in a private function in package.el...)?

I'd suggest you ditch -pkg.el file and just use your main .el to define package descriptor.

doublep commented 4 years ago

To clarify, it fails in function package-dir-info, not in Eldev itself.

mithrandi commented 4 years ago

Ahhh oops :blush:

The way straight.el loads it does not care about this I think, but probably everything else is broken.