Subject: bug#63288: 30.0.50; Emacs 30 packages fail to build with native comp on some machines

From: Pip Cet <[email-masked]>
Date: Mon, 17 Feb 2025 15:16:43 +0000

"Stefan Monnier" <[email-masked]> writes:

>> diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
>> index caaffcf19be..42830ca9f7a 100644
>> --- a/lisp/emacs-lisp/cl-macs.el
>> +++ b/lisp/emacs-lisp/cl-macs.el
>> @@ -2701,7 +2701,7 @@ cl--do-proclaim
>>  	 (let ((speed (assq (nth 1 (assq 'speed (cdr spec)))
>>  			    '((0 nil) (1 t) (2 t) (3 t))))
>>  	       (safety (assq (nth 1 (assq 'safety (cdr spec)))
>> -			     '((0 t) (1 t) (2 t) (3 nil)))))
>> +			     '((0 t) (1 nil) (2 nil) (3 nil)))))
>>  	   (if speed (setq cl--optimize-speed (car speed)
>>  			   byte-optimize (nth 1 speed)))
>>  	   (if safety (setq cl--optimize-safety (car safety)
>
> LGTM.  I'd also deprecate this machinery.

I really don't understand this code, I'm afraid.  In particular,
(cl--do-proclaim) often affects global variables, but we still defer
them until we load cl-macs.el.  That looks to me like another similar
accident waiting to happen (debugging this one took a while, and there
was a good amount of luck involved).

So I'll commit the minimal change above, and hope that the rest of the
problem goes away when you have the time to look at it next :-)

> For the case at hand, I think a better option is to add keyword
> arguments to `cl-defstruct` to control whether accessors need to check
> the type of their arg.

That makes sense to me. Setting byte-compile-delete-errors means you
cannot compile any "normal" Elisp code, not just skipped type checks.
It's -Ofast, not -DNDEBUG; you should never use the former, only the
latter.

In any case, the indentation in eieio-core.el is also confusing, IMHO
:-)

Pip