From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Upgrading elpa packages results in Lisp nesting exceeds max-lisp-eval-depth... Date: Sun, 06 Oct 2019 13:11:24 -0400 Message-ID: References: <5BA693B5-2A12-46F7-BE5F-8EE8D5215452@gmail.com> <87y2xxhqck.fsf@web.de> <87imp1ncd0.fsf@fastmail.fm> <87o8ytzyk4.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="142411"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 06 19:11:51 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iHA4U-000avE-Vo for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Oct 2019 19:11:51 +0200 Original-Received: from localhost ([::1]:35944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHA4T-0005PP-RS for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Oct 2019 13:11:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36340) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHA4I-0005PF-GR for help-gnu-emacs@gnu.org; Sun, 06 Oct 2019 13:11:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHA4H-0005tQ-9n for help-gnu-emacs@gnu.org; Sun, 06 Oct 2019 13:11:38 -0400 Original-Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:51196 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iHA4H-0005sC-2M for help-gnu-emacs@gnu.org; Sun, 06 Oct 2019 13:11:37 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1iHA4D-000agt-Hn for help-gnu-emacs@gnu.org; Sun, 06 Oct 2019 19:11:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Cancel-Lock: sha1:mFfIP9Let42UnckxRzRVVbBXNXo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:121615 Archived-At: >> I don't know about the OP, but I myself don't use helm and nothing >> helm-related seems to be installed: >> >> ~ $ v .elpa/helm* >> .elpa/helm*: No such file or directory >> >> So why would I get the error, then? > > Hmm, the error happens in `async-bytecomp-get-allowed-pkgs', it loops > over `async-bytecomp-allowed-packages' which includes helm (hardcoded in > async-bytecomp.el !). When you upgrade packages > `async-bytecomp-get-allowed-pkgs' is called and that produces the issue > no matter which packages you have installed. Indeed it's a bug in async.el. Does the patch below help? [ Of course, package--get-deps should be fixed accordingly. ] Stefan diff --git a/packages/async/async-bytecomp.el b/packages/async/async-bytecomp.el index 082b31adb..ae24cfce8 100644 --- a/packages/async/async-bytecomp.el +++ b/packages/async/async-bytecomp.el @@ -108,46 +108,30 @@ All *.elc files are systematically deleted before proceeding." (defvar package-alist) (declare-function package-desc-reqs "package.el" (cl-x)) -(defun async-bytecomp--get-package-deps (pkg &optional only) +(defun async-bytecomp--get-package-deps (pkgs) ;; Same as `package--get-deps' but parse instead `package-archive-contents' ;; because PKG is not already installed and not present in `package-alist'. ;; However fallback to `package-alist' in case PKG no more present ;; in `package-archive-contents' due to modification to `package-archives'. ;; See issue #58. - (let* ((pkg-desc (cadr (or (assq pkg package-archive-contents) - (assq pkg package-alist)))) - (direct-deps (cl-loop for p in (package-desc-reqs pkg-desc) - for name = (car p) - when (or (assq name package-archive-contents) - (assq name package-alist)) - collect name)) - (indirect-deps (unless (eq only 'direct) - (delete-dups - (cl-loop for p in direct-deps append - (async-bytecomp--get-package-deps p)))))) - (cl-case only - (direct direct-deps) - (separate (list direct-deps indirect-deps)) - (indirect indirect-deps) - (t (delete-dups (append direct-deps indirect-deps)))))) - -(defun async-bytecomp-get-allowed-pkgs () - (when (and async-bytecomp-allowed-packages - (listp async-bytecomp-allowed-packages)) - (if package-archive-contents - (cl-loop for p in async-bytecomp-allowed-packages - when (assq p package-archive-contents) - append (async-bytecomp--get-package-deps p) into reqs - finally return - (delete-dups - (append async-bytecomp-allowed-packages reqs))) - async-bytecomp-allowed-packages))) + (let ((seen '())) + (while pkgs + (let ((pkg (pop pkgs))) + (if (memq pkg seen) + nil ;; Done already! + (let ((pkg-desc (cadr (or (assq pkg package-archive-contents) + (assq pkg package-alist))))) + (when pkg-desc + (push pkg seen) + (setq pkgs (nconc pkgs (package-desc-reqs pkg-desc)))))))) + seen)) (defun async--package-compile (orig-fun pkg-desc &rest args) (let ((cur-package (package-desc-name pkg-desc)) (pkg-dir (package-desc-dir pkg-desc))) - (if (or (equal async-bytecomp-allowed-packages '(all)) - (memq cur-package (async-bytecomp-get-allowed-pkgs))) + (if (or (member async-bytecomp-allowed-packages '(t all (all))) + (memq cur-package (async-bytecomp--get-package-deps + async-bytecomp-allowed-packages))) (progn ;; FIXME: Why do we use (eq cur-package 'async) once ;; and (string= cur-package "async") afterwards?