GNU bug report logs - #78818
31.0.50; Missing lexical-binding cookies when compiling trampolines

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Tue, 17 Jun 2025 18:39:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Mendler <mail <at> daniel-mendler.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Andrea Corallo <acorallo <at> gnu.org>, 78818 <at> debbugs.gnu.org
Subject: bug#78818: 31.0.50; Missing lexical-binding cookies when compiling trampolines
Date: Sat, 05 Jul 2025 10:02:42 +0200
I will check if the issue still occurs when I recompile Emacs the next
time. Andreas fix looks correct, since it adds the missing cookie. From
my side the issue can be closed. Thanks!

Eli Zaretskii <eliz <at> gnu.org> writes:
> Ping!  Daniel, could you please respond?
>
>> From: Andrea Corallo <acorallo <at> gnu.org>
>> Cc: Daniel Mendler <mail <at> daniel-mendler.de>,  78818 <at> debbugs.gnu.org
>> Date: Mon, 23 Jun 2025 16:09:13 -0400
>> 
>> Andrea Corallo <acorallo <at> gnu.org> writes:
>> 
>> > Eli Zaretskii <eliz <at> gnu.org> writes:
>> >
>> >>> From: Daniel Mendler <mail <at> daniel-mendler.de>
>> >>> Cc: 78818 <at> debbugs.gnu.org, Andrea Corallo <acorallo <at> gnu.org>
>> >>> Date: Wed, 18 Jun 2025 13:52:42 +0200
>> >>>
>> >>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >>>
>> >>> >> Date: Tue, 17 Jun 2025 20:38:20 +0200
>> >>> >> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>> >>> >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> >>> >>
>> >>> >> In the *Native-compile-Log* I see the following messages on a newly
>> >>> >> compiled Emacs 31 from the current Emacs master branch:
>> >>> >>
>> >>> >> Warning (files): Missing ‘lexical-binding’ cookie in "/tmp/emacs-int-comp-subr--trampoline-72756e2d686f6f6b73_run_hooks_0-ZQkOM2.el".
>> >>> >> You can add one with ‘M-x elisp-enable-lexical-binding RET’.
>> >>> >> See ‘(elisp)Selecting Lisp Dialect’ and ‘(elisp)Converting to Lexical Binding’
>> >>> >> for more information.
>> >>> >> Compiling $HOME/.config/emacs/eln-cache/31.0.50-45ab2aa9/subr--trampoline-72756e2d686f6f6b73_run_hooks_0.eln...
>> >>> >
>> >>> > Please show a recipe to reproduce this problem starting from "emacs -Q".
>> >>> > Or at least figure out and tell here compilation of what ELisp file
>> >>> > triggered this message (it sounds like it's part of your init
>> >>> > configuration?).  I started "emacs -Q", but didn't see any such
>> >>> > messages that I could use as a starting point for investigation.
>> >>> >
>> >>> > Or, if I'm missing something, could you suggest how to investigate
>> >>> > this given the information you provided above?
>> >>>
>> >>> The trampoline .el file is generated by `comp--final' in comp.el. I
>> >>> found this by grepping for `emacs-int-comp'. The generated Elisp file
>> >>> doesn't include a `lexical-binding' cookie, which seems to trigger the
>> >>> warning. As far as I understand the trampolines are generated if native
>> >>> subrs are advised in the configuration.
>> >>
>> >> Thanks.  We insert the lexical-binding cookie in
>> >> comp--run-async-workers, but maybe trampoline compilation doesn't use
>> >> that?
>> >>
>> >> Andrea, any suggestions?
>> >
>> > Yep, I'm testing this I think it should work:
>> >
>> > modified   lisp/emacs-lisp/comp.el
>> > @@ -3363,7 +3363,7 @@ comp--final
>> >                           nil ".el"))
>> >               (default-directory invocation-directory))
>> >          (with-temp-file temp-file
>> > -          (insert ";; -*-coding: utf-8-emacs-unix; -*-\n")
>> > +          (insert ";; -*- coding: utf-8-emacs-unix; lexical-binding: t -*-\n")
>> >            (mapc (lambda (e)
>> >                    (insert (prin1-to-string e)))
>> >                  expr))
>> 
>> Ok I think it works so I've installed it on master as baf0c822026.
>> 
>> Daniel could you double check it works for your case?
>> 
>> Thanks
>> 
>>   Andrea
>> 




This bug report was last modified 12 days ago.

Previous Next


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