unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36022: 26.2.50; errors byte-compiling gnus.el
@ 2019-05-31 11:09 Sven Joachim
  2019-05-31 11:29 ` Sven Joachim
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Joachim @ 2019-05-31 11:09 UTC (permalink / raw)
  To: 36022; +Cc: Sven Joachim

Byte-compiling lisp/gnus/gnus.el is broken on emacs-26, this is what
happens here after removing the corresponding gnus.elc file:

,----
| make[1]: Verzeichnis „/usr/local/src/emacs/lisp“ wird betreten
| EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  -f batch-byte-compile gnus/gnus.el
| 
| 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.


In GNU Emacs 26.2.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 2.24.32)
 of 2019-05-31 built on turtle
Repository revision: b3df3729596332a39404c364798a61bfef2adcc2
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description:	Debian GNU/Linux 10 (buster)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --build x86_64-linux-gnu --host x86_64-linux-gnu
 --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var --infodir=/usr/share/info/emacs-snapshot
 --mandir=/usr/share/man --without-pop
 --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/26.1.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1.50/site-lisp:/usr/share/emacs/site-lisp
 --without-wide-int --disable-silent-rules --without-compress-install
 --with-x=yes --with-x-toolkit=gtk2 --without-gconf --without-gsettings
 build_alias=x86_64-linux-gnu host_alias=x86_64-linux-gnu 'CFLAGS=-g -O2
 -fdebug-prefix-map=/usr/local/src/emacs=. -fstack-protector-strong
 -Wformat -Werror=format-security' 'LDFLAGS=-Wl,-z,relro
 -Wl,--as-needed' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 -DDEBIAN
 -DSITELOAD_PURESIZE_EXTRA=5000''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GLIB NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 94724 7154)
 (symbols 48 20386 1)
 (miscs 40 44 93)
 (strings 32 28378 1196)
 (string-bytes 1 744002)
 (vectors 16 14076)
 (vector-slots 8 502394 6816)
 (floats 8 49 68)
 (intervals 56 249 0)
 (buffers 992 11))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36022: 26.2.50; errors byte-compiling gnus.el
  2019-05-31 11:09 bug#36022: 26.2.50; errors byte-compiling gnus.el Sven Joachim
@ 2019-05-31 11:29 ` Sven Joachim
  2019-05-31 12:41   ` Noam Postavsky
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Joachim @ 2019-05-31 11:29 UTC (permalink / raw)
  To: 36022

On 2019-05-31 13:09 +0200, Sven Joachim wrote:

> Byte-compiling lisp/gnus/gnus.el is broken on emacs-26, this is what
> happens here after removing the corresponding gnus.elc file:
>
> ,----
> | make[1]: Verzeichnis „/usr/local/src/emacs/lisp“ wird betreten
> | EMACSLOADPATH= '../src/emacs' -batch --no-site-file --no-site-lisp
> | --eval '(setq load-prefer-newer t)' -f batch-byte-compile
> | gnus/gnus.el
> | 
> | 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.

Cheers,
       Sven





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36022: 26.2.50; errors byte-compiling gnus.el
  2019-05-31 11:29 ` Sven Joachim
@ 2019-05-31 12:41   ` Noam Postavsky
  2019-06-01 19:43     ` Basil L. Contovounesios
  0 siblings, 1 reply; 6+ messages in thread
From: Noam Postavsky @ 2019-05-31 12:41 UTC (permalink / raw)
  To: Sven Joachim; +Cc: 36022

[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]

tags 36022 + patch
quit

Sven Joachim <svenjoac@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1402 bytes --]

From 9ea3fb966ac7827a4c8bd51f47d35468863a5446 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#36022: 26.2.50; errors byte-compiling gnus.el
  2019-05-31 12:41   ` Noam Postavsky
@ 2019-06-01 19:43     ` Basil L. Contovounesios
  2019-06-01 21:11       ` Noam Postavsky
  0 siblings, 1 reply; 6+ messages in thread
From: Basil L. Contovounesios @ 2019-06-01 19:43 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 36022, Sven Joachim

Noam Postavsky <npostavs@gmail.com> writes:

> Sven Joachim <svenjoac@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

Glenn already fixed this[1], right?  (Thanks Glenn!)

[1: 008b263fee]: * lisp/gnus/gnus.el: Mark autoloaded macros as such.
  2019-06-01 11:33:25 -0700
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=008b263feeba8951a95bec93ec0a9e263cf230f7

-- 
Basil





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36022: 26.2.50; errors byte-compiling gnus.el
  2019-06-01 19:43     ` Basil L. Contovounesios
@ 2019-06-01 21:11       ` Noam Postavsky
  2019-06-01 21:52         ` Noam Postavsky
  0 siblings, 1 reply; 6+ messages in thread
From: Noam Postavsky @ 2019-06-01 21:11 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 36022, Sven Joachim

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Noam Postavsky <npostavs@gmail.com> writes:
>
>> Sven Joachim <svenjoac@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
>
> Glenn already fixed this[1], right?  (Thanks Glenn!)
>
> [1: 008b263fee]: * lisp/gnus/gnus.el: Mark autoloaded macros as such.
>   2019-06-01 11:33:25 -0700
>   https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=008b263feeba8951a95bec93ec0a9e263cf230f7

I get this compilation warning though:

  ELC      gnus/gnus.elc
Warning: Eager macro-expansion skipped due to cycle:
  … => (load "gnus.el") => (macroexpand-all (defalias (quote gnus-interactive) …)) => (macroexpand (gnus-summary-skip-intangible …)) => (load "gnus.el")






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36022: 26.2.50; errors byte-compiling gnus.el
  2019-06-01 21:11       ` Noam Postavsky
@ 2019-06-01 21:52         ` Noam Postavsky
  0 siblings, 0 replies; 6+ messages in thread
From: Noam Postavsky @ 2019-06-01 21:52 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 36022, Sven Joachim

tags 36022 fixed
close 36022 
quit

>> Glenn already fixed this[1], right?  (Thanks Glenn!)
>>
>> [1: 008b263fee]: * lisp/gnus/gnus.el: Mark autoloaded macros as such.
>>   2019-06-01 11:33:25 -0700
>>   https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=008b263feeba8951a95bec93ec0a9e263cf230f7
>
> I get this compilation warning though:
>
>   ELC      gnus/gnus.elc
> Warning: Eager macro-expansion skipped due to cycle:
>   … => (load "gnus.el") => (macroexpand-all (defalias (quote gnus-interactive) …)) => (macroexpand (gnus-summary-skip-intangible …)) => (load "gnus.el")

Actually I guess this warning isn't a problem, it just makes explicit
what was happening all along.

I pushed my bytecomp fix to emacs-26, I'll see if I can make the 'macros
autoloaded as function' a proper compile warning in master.

2860285621 2019-06-01T17:48:43-04:00 "Allow macros autoloaded as functions during bytecomp (Bug#36022)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2860285621eb890697ca122cd6ede8c3f03566d6






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-01 21:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31 11:09 bug#36022: 26.2.50; errors byte-compiling gnus.el Sven Joachim
2019-05-31 11:29 ` Sven Joachim
2019-05-31 12:41   ` Noam Postavsky
2019-06-01 19:43     ` Basil L. Contovounesios
2019-06-01 21:11       ` Noam Postavsky
2019-06-01 21:52         ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).