Closed xuzhao9 closed 3 years ago
It's not use-package
, and you're not doing anything wrong. I'm seeing a lot of packages failing to update today, with the same error and similar backtrace.
Seems the $NAME-pkg.el
files in recent packages have:
(define-package NAME "VERSION" .... )
but all older versions and packages have:
(define-package "NAME" "VERSION" ... )
The symbol NAME
instead of the string "NAME"
produces the error message.
It's not use-package that is the problem as was mentioned in other linked issues. This seems to be an issue with the package files in MELPA. If you go into the elpa directory and find use-package-#.#.#/ directory. Open use-package-pkg.el you will see this:
(define-package use-package "2.4.1" "A configuration macro for simplifying your .emacs"
'((emacs "24.3")
(bind-key "2.4"))
:commit "caa92f1d64fc25480551757d854b4b49981dfa6b" :authors
(("John Wiegley" . "johnw@newartisans.com"))
:maintainer
("John Wiegley" . "johnw@newartisans.com")
:keywords
("dotemacs" "startup" "speed" "config" "package")
:url "https://github.com/jwiegley/use-package")
;; Local Variables:
;; no-byte-compile: t
;; End:
Add double-quotes around use-package
and it will work as normal. You'll need to repeat this for any other packages that you install with use-package that report the same issue. :/ This seems to be impacting both MELPA and MELPA-stable which indicates lack of proper testing or continuous integration on the part of MELPA. Hope they do something about this as far as a long term fix. Can't believe that both MELPA-stable and MELPA would be broken for the same reason at the same time.
For clarity, this is what it should look like after the edit.
(define-package "use-package" "2.4.1" "A configuration macro for simplifying your .emacs"
'((emacs "24.3")
(bind-key "2.4"))
:commit "caa92f1d64fc25480551757d854b4b49981dfa6b" :authors
(("John Wiegley" . "johnw@newartisans.com"))
:maintainer
("John Wiegley" . "johnw@newartisans.com")
:keywords
("dotemacs" "startup" "speed" "config" "package")
:url "https://github.com/jwiegley/use-package")
;; Local Variables:
;; no-byte-compile: t
;; End:
UPDATE 1: Other packages I've found to be impacted by this so far...
UPDATE 2:
!DISCLAIMER! THIS MIGHT BREAK YOUR COMPUTER, RUN AT YOUR OWN RISK
For the brave, this one-liner might fix the problem for you. Try to startup emacs, if you see the stringp issue, run the one-liner and try again. Repeat until hopefully your init completes.
find elpa -type f -iname "*-pkg.el" -exec sed -i '/^(define-package "/! s/define-package \([a-zA-Z0-9\-]*\)/define-package "\1"/' {} \;
This seems to be impacting both MELPA and MELPA-stable which indicates lack of proper testing or continuous integration on the part of MELPA.
You can see in the recent MELPA commits that the CI is indeed failing since the commit that introduced the bug. However, it's easy to overlook that little red X. I'm sure the bug will be fixed soon.
Thank everybody for the detailed explanation! Hope it will help others who also meet this problem. Since the root cause is unrelated with use-package, I will close the issue.
@wkmanire I may be reading it wrong, but it looks like that sed
command will match package definitions for which the name is already a string.
@wkmanire I may be reading it wrong, but it looks like that
sed
command will match package definitions for which the name is already a string.
There are two expressions, the first one says "Skip lines that already have the quotes". The second one does the edit. I used this myself and it seems to not have broken anything. If you do find a problem please let me know and I'll update my comment with the correction.
Thanks, I'm not an expert on the finer points of sed
. :)
After starting up emacs 27.1 with "-q" option, I run the following commands:
Then I run package-install use-package. Emacs shows it fails to install use-package 20201110.2133, error message: Wrong type argument: stringp, use-package
A full paste of backtrace is here: https://pastebin.com/QjzByWzb