* bug#71805: master: New interpreted function format prevents native compilation.
@ 2024-06-27 16:00 Alan Mackenzie
2024-06-29 12:11 ` Eli Zaretskii
2024-06-29 21:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 4+ messages in thread
From: Alan Mackenzie @ 2024-06-27 16:00 UTC (permalink / raw)
To: 71805
[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]
Hello, Emacs.
With a recent master repo (likely also the emacs-30 branch):
(i) mkdir ~/cc-mode.hg.
(ii) chdir ~/cc-mode.hg.
(iii) Copy cc-mode.hg.tar.gz from this bug report to ~/cc-mode.hg.
(iv) tar -zxf cc-mode.tar.gz.
The CC Mode source files should now be in the current directory.
(v) emacs -Q -batch -f batch-byte-compile *.el
The CC Mode .elc files should now be present.
(vi) emacs -Q.
(vii) M-: (push "~/cc-mode.hg" load-path).
(viii) M-x load-library RET cc-mode RET.
(ix) (After a brief wait) C-x b *Async-native-compile-log* RET.
(x) Search the buffer for "#" with C-s or C-r. This will find the error
line
/home/awk/cc-mode.hg/cc-fonts.el: Error Wrong type argument: listp, #[(form) (`(cdr (backquote-process ,form))) nil]
(where "awk" is your user name).
The native compiler has thus failed to compile cc-fonts.el, this being
something to do with the new interpreted form
#[(form) (`(cdr (backquote-process ,form))) nil]
being somewhere where a list form is expected.
Possibly of interest: (defun (form) (`(cdr (backquote-process ,form)))
nil] looks like a failed expansion of backquote (see
lisp/emacs-lisp/backquote.el).
--
Alan Mackenzie (Nuremberg, Germany).
[-- Attachment #2: cc-mode.hg.tar.gz --]
[-- Type: application/gzip, Size: 421830 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#71805: master: New interpreted function format prevents native compilation.
2024-06-27 16:00 bug#71805: master: New interpreted function format prevents native compilation Alan Mackenzie
@ 2024-06-29 12:11 ` Eli Zaretskii
2024-06-29 20:32 ` Andrea Corallo
2024-06-29 21:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-06-29 12:11 UTC (permalink / raw)
To: Alan Mackenzie, Stefan Monnier, Andrea Corallo; +Cc: 71805
> Date: Thu, 27 Jun 2024 16:00:58 +0000
> From: Alan Mackenzie <acm@muc.de>
>
> With a recent master repo (likely also the emacs-30 branch):
> (i) mkdir ~/cc-mode.hg.
> (ii) chdir ~/cc-mode.hg.
> (iii) Copy cc-mode.hg.tar.gz from this bug report to ~/cc-mode.hg.
> (iv) tar -zxf cc-mode.tar.gz.
> The CC Mode source files should now be in the current directory.
>
> (v) emacs -Q -batch -f batch-byte-compile *.el
> The CC Mode .elc files should now be present.
>
> (vi) emacs -Q.
> (vii) M-: (push "~/cc-mode.hg" load-path).
> (viii) M-x load-library RET cc-mode RET.
> (ix) (After a brief wait) C-x b *Async-native-compile-log* RET.
>
> (x) Search the buffer for "#" with C-s or C-r. This will find the error
> line
>
> /home/awk/cc-mode.hg/cc-fonts.el: Error Wrong type argument: listp, #[(form) (`(cdr (backquote-process ,form))) nil]
>
> (where "awk" is your user name).
>
> The native compiler has thus failed to compile cc-fonts.el, this being
> something to do with the new interpreted form
>
> #[(form) (`(cdr (backquote-process ,form))) nil]
>
> being somewhere where a list form is expected.
>
> Possibly of interest: (defun (form) (`(cdr (backquote-process ,form)))
> nil] looks like a failed expansion of backquote (see
> lisp/emacs-lisp/backquote.el).
Andrea and Stefan, can you look into this, please?
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#71805: master: New interpreted function format prevents native compilation.
2024-06-29 12:11 ` Eli Zaretskii
@ 2024-06-29 20:32 ` Andrea Corallo
0 siblings, 0 replies; 4+ messages in thread
From: Andrea Corallo @ 2024-06-29 20:32 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Alan Mackenzie, Stefan Monnier, 71805
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Thu, 27 Jun 2024 16:00:58 +0000
>> From: Alan Mackenzie <acm@muc.de>
>>
>> With a recent master repo (likely also the emacs-30 branch):
>> (i) mkdir ~/cc-mode.hg.
>> (ii) chdir ~/cc-mode.hg.
>> (iii) Copy cc-mode.hg.tar.gz from this bug report to ~/cc-mode.hg.
>> (iv) tar -zxf cc-mode.tar.gz.
>> The CC Mode source files should now be in the current directory.
>>
>> (v) emacs -Q -batch -f batch-byte-compile *.el
>> The CC Mode .elc files should now be present.
>>
>> (vi) emacs -Q.
>> (vii) M-: (push "~/cc-mode.hg" load-path).
>> (viii) M-x load-library RET cc-mode RET.
>> (ix) (After a brief wait) C-x b *Async-native-compile-log* RET.
>>
>> (x) Search the buffer for "#" with C-s or C-r. This will find the error
>> line
>>
>> /home/awk/cc-mode.hg/cc-fonts.el: Error Wrong type argument: listp, #[(form) (`(cdr (backquote-process ,form))) nil]
>>
>> (where "awk" is your user name).
>>
>> The native compiler has thus failed to compile cc-fonts.el, this being
>> something to do with the new interpreted form
>>
>> #[(form) (`(cdr (backquote-process ,form))) nil]
>>
>> being somewhere where a list form is expected.
>>
>> Possibly of interest: (defun (form) (`(cdr (backquote-process ,form)))
>> nil] looks like a failed expansion of backquote (see
>> lisp/emacs-lisp/backquote.el).
>
> Andrea and Stefan, can you look into this, please?
Sure, I can try but on Monday :)
Andrea
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#71805: master: New interpreted function format prevents native compilation.
2024-06-27 16:00 bug#71805: master: New interpreted function format prevents native compilation Alan Mackenzie
2024-06-29 12:11 ` Eli Zaretskii
@ 2024-06-29 21:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-06-29 21:30 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: 71805
> With a recent master repo (likely also the emacs-30 branch):
> (i) mkdir ~/cc-mode.hg.
> (ii) chdir ~/cc-mode.hg.
> (iii) Copy cc-mode.hg.tar.gz from this bug report to ~/cc-mode.hg.
> (iv) tar -zxf cc-mode.tar.gz.
> The CC Mode source files should now be in the current directory.
>
> (v) emacs -Q -batch -f batch-byte-compile *.el
> The CC Mode .elc files should now be present.
I haven't tried quite that command, instead I went straight for:
emacs -Q --batch -L . \
--eval '(setq debug-on-error t byte-compile-debug t)' \
-f batch-byte-compile cc-fonts.el
which gave me an error with the following backtrace:
Debugger entered--Lisp error: (wrong-type-argument listp #f(lambda (form) :dynbind `(cdr (backquote-process ,form))))
car(#f(lambda (form) :dynbind `(cdr (backquote-process ,form))))
#f(compiled-function (evald func args flags) #<bytecode -0x1893e2b83afae926>)(nil defmacro (bq-process macro . #f(lambda (form) :dynbind `(cdr (backquote-process ,form)))) nil)
mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0x1893e2b83afae926>) debug-early--handler)
debug-early-backtrace(debug-early--handler)
debug--early((wrong-type-argument listp #f(lambda (form) :dynbind `(cdr (backquote-process ,form)))) debug-early--handler)
debug-early--handler((wrong-type-argument listp #f(lambda (form) :dynbind `(cdr (backquote-process ,form)))))
(defmacro bq-process macro . #f(lambda (form) :dynbind `(cdr (backquote-process ,form))))
eval((defmacro bq-process macro . #f(lambda (form) :dynbind `(cdr (backquote-process ,form)))))
(progn (eval (cons 'defmacro (cons fun temp-macro))) nil)
(if temp-macro (progn (eval (cons 'defmacro (cons fun temp-macro))) nil) (fset fun (intern (concat "cc-bytecomp-ignore-fun:" (symbol-name fun)))) nil)
(if (not (fboundp fun)) (if temp-macro (progn (eval (cons 'defmacro (cons fun temp-macro))) nil) (fset fun (intern (concat "cc-bytecomp-ignore-fun:" (symbol-name fun)))) nil))
(let ((fun (car (car p))) (temp-macro (car (cdr (car p))))) (if (not (fboundp fun)) (if temp-macro (progn (eval (cons 'defmacro (cons fun temp-macro))) nil) (fset fun (intern (concat "cc-bytecomp-ignore-fun:" (symbol-name fun)))) nil)))
(while p (message "(car p) == %S" (car p)) (let ((fun (car (car p))) (temp-macro (car (cdr (car p))))) (if (not (fboundp fun)) (if temp-macro (progn (eval (cons 'defmacro (cons fun temp-macro))) nil) (fset fun (intern (concat "cc-bytecomp-ignore-fun:" (symbol-name fun)))) nil))) (setq p (cdr p)))
(let (p) (if cc-bytecomp-environment-set (error "Byte compilation environment already set - perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere")) (setq p cc-bytecomp-unbound-variables) (while p (if (not (boundp (car p))) (progn (eval (list 'defvar (car p))) (set (car p) (intern (concat "cc-bytecomp-ignore-var:" (symbol-name ...)))) nil)) (setq p (cdr p))) (setq p cc-bytecomp-original-functions) (while p (message "(car p) == %S" (car p)) (let ((fun (car (car p))) (temp-macro (car (cdr (car p))))) (if (not (fboundp fun)) (if temp-macro (progn (eval (cons ... ...)) nil) (fset fun (intern (concat "cc-bytecomp-ignore-fun:" ...))) nil))) (setq p (cdr p))) (setq p cc-bytecomp-original-properties) (while p (let ((sym (car (car (car p)))) (prop (cdr (car (car p)))) (tempdef (car (cdr (car p))))) (put sym prop tempdef) nil) (setq p (cdr p))) (setq p (reverse cc-bytecomp-push-vars)) (while p (let ((var (car (car p))) (setqd-val (car (cdr (cdr ...))))) (set var setqd-val) nil) (setq p (cdr p))) (setq cc-bytecomp-environment-set t) nil)
(if (not (cc-bytecomp-is-loading)) (let (p) (if cc-bytecomp-environment-set (error "Byte compilation environment already set - perhaps a `cc-bytecomp-restore-environment' is forgotten somewhere")) (setq p cc-bytecomp-unbound-variables) (while p (if (not (boundp (car p))) (progn (eval (list 'defvar (car p))) (set (car p) (intern (concat "cc-bytecomp-ignore-var:" ...))) nil)) (setq p (cdr p))) (setq p cc-bytecomp-original-functions) (while p (message "(car p) == %S" (car p)) (let ((fun (car (car p))) (temp-macro (car (cdr ...)))) (if (not (fboundp fun)) (if temp-macro (progn (eval ...) nil) (fset fun (intern ...)) nil))) (setq p (cdr p))) (setq p cc-bytecomp-original-properties) (while p (let ((sym (car (car ...))) (prop (cdr (car ...))) (tempdef (car (cdr ...)))) (put sym prop tempdef) nil) (setq p (cdr p))) (setq p (reverse cc-bytecomp-push-vars)) (while p (let ((var (car (car p))) (setqd-val (car (cdr ...)))) (set var setqd-val) nil) (setq p (cdr p))) (setq cc-bytecomp-environment-set t) nil))
cc-bytecomp-setup-environment()
So I added some `message`s in the `while p` loop of
`cc-bytecomp-setup-environment` where there's the funny
(eval `(defmacro ,fun ,@temp-macro))
and tried again with an older version of Emacs, to see how that worked:
/usr/bin/emacs -Q --batch -L . \
--eval '(setq debug-on-error t byte-compile-debug t)' \
-f batch-byte-compile cc-fonts.el
(car p) == (c-clear-char-property-fun nil unbound)
[...]
(car p) == (bq-process (macro lambda (form) `(cdr (backquote-process ,form))) unbound)
[...]
(car p) == (bq-process (macro lambda (form) `(cdr (backquote-process ,form))) unbound)
evalling: (defmacro bq-process macro lambda (form) `(cdr (backquote-process ,form)))
And indeed in Emacs-28, it seems that
(eval '(defmacro bq-process macro lambda (form) `(cdr (backquote-process ,form))))
did not signal an error (tho it resulted in an incorrect definition):
ELISP> (eval '(defmacro bq-process macro lambda (form) `(cdr (backquote-process ,form))))
bq-process
ELISP> (symbol-function 'bq-process)
(macro lambda macro lambda
(form)
`(cdr (backquote-process ,form)))
ELISP>
I don't know what your code intends to do but doing
(eval `(defmacro ,fun ,@temp-macro))
when `temp-macro` comes from the output of `symbol-function`
(apparently in `cc-bytecomp-defmacro`) doesn't seem to make much sense.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-29 21:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 16:00 bug#71805: master: New interpreted function format prevents native compilation Alan Mackenzie
2024-06-29 12:11 ` Eli Zaretskii
2024-06-29 20:32 ` Andrea Corallo
2024-06-29 21:30 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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.