From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70357: 30.0.50; loadup.el, load nadvice before seq Date: Sun, 14 Apr 2024 10:14:39 -0400 Message-ID: References: <861q79ss2s.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24221"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 70357@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 14 16:15:11 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rw0dS-00061i-Ga for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Apr 2024 16:15:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rw0dB-0000OW-3k; Sun, 14 Apr 2024 10:14:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rw0d9-0000M6-80 for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:14:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rw0d8-0002pm-VO for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:14:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rw0dK-0002yt-11 for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 10:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2024 14:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70357 X-GNU-PR-Package: emacs Original-Received: via spool by 70357-submit@debbugs.gnu.org id=B70357.171310410111450 (code B ref 70357); Sun, 14 Apr 2024 14:15:01 +0000 Original-Received: (at 70357) by debbugs.gnu.org; 14 Apr 2024 14:15:01 +0000 Original-Received: from localhost ([127.0.0.1]:35932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0dI-0002yR-R4 for submit@debbugs.gnu.org; Sun, 14 Apr 2024 10:15:01 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50189) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw0dG-0002xB-64 for 70357@debbugs.gnu.org; Sun, 14 Apr 2024 10:14:58 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B581E80C41; Sun, 14 Apr 2024 10:14:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1713104080; bh=2seuqM21cheYeR8OrGvPNKke+Lfsg1ru9catyY3A9mw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jutb+JroSncjJ+XP3ojONluBtYmj35+etDmFAGR+W6BaSKr5XEtMB0E2hjS6LFLNv w6KBd5iR+xaNpxRkxfKz2PmeB341nIduK6xFkkQ7Jy4z/xeN0Gv11kRrCOPFfmO+00 MprAnWI/NdVYnDpU2uv52oZBMaPEjgkiDo7XsupKIN66sLJ+8qo54hdqNJr45HRVQL fmfS9WzKTihZmV/o7bVxaQAhFNYvRwhqK9amYoszSJkHY9XNEecMLax9ZuwjgMhqyZ zs7B/bDrpT5jMzPgSU84rS7VJd8G8gJnce6UjQ+/Vcsc8vfZnwHbID/10yUDPHghPj SoqVwHpHBVN0Q== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 98BE380A6B; Sun, 14 Apr 2024 10:14:40 -0400 (EDT) Original-Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6C74812021C; Sun, 14 Apr 2024 10:14:40 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Sat, 13 Apr 2024 08:44:24 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283281 Archived-At: > I did not look in enough detail to see the specific problem. > E.g. I don't know what is the actual warning that we're trying to emit. Oh, I see the origin of the problem: `cl-generic` calls `byte-compile` too early during the bootstrap. Normally, this is avoided with: (defvar cl--generic-compiler ;; Don't byte-compile the dispatchers if cl-generic itself is not ;; compiled. Otherwise the byte-compiler and all the code on ;; which it depends needs to be usable before cl-generic is loaded, ;; which imposes a significant burden on the bootstrap. (if (not (compiled-function-p (lambda (x) (+ x 1)))) (lambda (exp) (eval exp t)) ;; But do byte-compile the dispatchers once bootstrap is passed: ;; the performance difference is substantial (like a 5x speedup on ;; the `eieio' elisp-benchmark)). ;; To avoid loading the byte-compiler during the final preload, ;; see `cl--generic-prefill-dispatchers'. #'byte-compile)) but in your case `cl-generic.el` has been compiled, so the `if` test decides to use the byte-compiler. I haven't figured out why this doesn't bite more often nor why it bites in this specific case (I haven't been able to reproduce the problem). A quick fix could be the patch below. Stefan diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index fb3278c08ab..c402f91d67c 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1492,7 +1492,8 @@ byte-compile--function-signature (and (eq 'macro (car-safe f)) (setq f (cdr f))) ;; Advice wrappers have "catch all" args, so fetch the actual underlying ;; function to find the real arguments. - (setq f (advice--cd*r f)) + (when (fboundp 'advice--cd*r) ;;nil during early bootstrap. + (setq f (advice--cd*r f))) (if (eq (car-safe f) 'declared) (byte-compile-arglist-signature (nth 1 f)) (condition-case nil