all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 70357@debbugs.gnu.org
Subject: bug#70357: 30.0.50; loadup.el, load nadvice before seq
Date: Sun, 14 Apr 2024 10:14:39 -0400	[thread overview]
Message-ID: <jwvedb8vy6z.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwvy19hzb84.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 13 Apr 2024 08:44:24 -0400")

> 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






  parent reply	other threads:[~2024-04-14 14:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 18:19 bug#70357: 30.0.50; loadup.el, load nadvice before seq Gerd Möllmann
2024-04-12 19:03 ` Eli Zaretskii
2024-04-12 20:43 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13  4:01   ` Gerd Möllmann
2024-04-13  5:22   ` Gerd Möllmann
2024-04-13  6:19   ` Eli Zaretskii
2024-04-13  7:07     ` Gerd Möllmann
2024-04-13  7:31       ` Eli Zaretskii
2024-04-13  7:39         ` Gerd Möllmann
2024-04-13  9:29           ` Eli Zaretskii
2024-04-13 12:44       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14  2:30         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14  6:26           ` Gerd Möllmann
2024-04-14  7:30             ` Eli Zaretskii
2024-04-14 12:48               ` Gerd Möllmann
2024-04-14 14:14         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-15  3:11           ` Gerd Möllmann
2024-04-15  6:16             ` Gerd Möllmann
2024-04-15  7:01               ` Gerd Möllmann
2024-04-15  7:55                 ` Gerd Möllmann
2024-04-15  8:01                   ` Gerd Möllmann
2024-04-15 12:11                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 12:47                       ` Gerd Möllmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvedb8vy6z.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70357@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.