GNU bug report logs - #36022
26.2.50; errors byte-compiling gnus.el

Previous Next

Package: emacs;

Reported by: Sven Joachim <svenjoac <at> gmx.de>

Date: Fri, 31 May 2019 11:10:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 26.2.50

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Sven Joachim <svenjoac <at> gmx.de>
Cc: 36022 <at> debbugs.gnu.org
Subject: bug#36022: 26.2.50; errors byte-compiling gnus.el
Date: Fri, 31 May 2019 08:41:45 -0400
[Message part 1 (text/plain, inline)]
tags 36022 + patch
quit

Sven Joachim <svenjoac <at> gmx.de> writes:

>> | In gnus-interactive:
>> | gnus/gnus.el:3335:15:Error: Forgot to expand macro gnus-data-header
>> | in (gnus-data-header (gnus-data-find (gnus-summary-article-number)))
>> | gnus/gnus.el:3337:11:Error: Forgot to expand macro gnus-data-find in (gnus-data-find (gnus-summary-article-number))
>> | gnus/gnus.el:3337:29:Error: Forgot to expand macro gnus-summary-article-number in (gnus-summary-article-number)
>> | make[1]: *** [Makefile:297: gnus/gnus.elc] Fehler 1
>> `----
>>
>> The same error occurs on a fresh bootstrap, however I can successfully
>> byte-compile gnus.elc with a snapshot from May 12, so something has
>> broken in the meantime on emacs-26.
>
> Bisection showed that commit 134edc10367a8434167656e631865c85b5f10c42
> ("Warn about wrong number of args for subrs (Bug#35767))" is the
> culprit.

I think this exposes what is arguably a bug in gnus.el, the
eval-when-compile around line 2378:

    ;; Define some autoload functions Gnus might use.
    (eval-and-compile

      ;; This little mapcar goes through the list below and marks the
      ;; symbols in question as autoloaded functions.

is autoloading gnus-data-header, gnus-data-find, and
gnus-summary-article-number as functions (i.e., the TYPE arg is nil),
even though they're actually macros.

But, we shouldn't start messing with that in the release branch, so here
is a patch which avoids triggering this error:

[0001-Allow-macros-autoloaded-as-functions-during-bytecomp.patch (text/x-diff, inline)]
From 9ea3fb966ac7827a4c8bd51f47d35468863a5446 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Fri, 31 May 2019 08:24:56 -0400
Subject: [PATCH] Allow macros autoloaded as functions during bytecomp
 (Bug#36022)

* lisp/emacs-lisp/bytecomp.el (byte-compile-callargs-warn): Don't pass
symbols which don't have a known definition to
byte-compile--function-signature, it fails to compile code which
previously compiled successfully (in particular, gnus.el which
autoloads some macros as if they were functions).
---
 lisp/emacs-lisp/bytecomp.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 72e81a653c..e3b34c189f 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1379,7 +1379,9 @@ (defun byte-compile-function-warn (f nargs def)
 (defun byte-compile-callargs-warn (form)
   (let* ((def (or (byte-compile-fdefinition (car form) nil)
 		  (byte-compile-fdefinition (car form) t)))
-         (sig (byte-compile--function-signature (or def (car form))))
+         (sig (cond (def (byte-compile--function-signature def))
+                    ((subrp (symbol-function (car form)))
+                     (subr-arity (symbol-function (car form))))))
 	 (ncall (length (cdr form))))
     ;; Check many or unevalled from subr-arity.
     (if (and (cdr-safe sig)
-- 
2.11.0


This bug report was last modified 6 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.