jwiegley/emacs-async

Invalid read syntax: "#<" with async-bytecomp

ShuguangSun opened this issue · 13 comments

Please refer to this info:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-02/msg00003.html
And from the replies, Emacs has a new mechanism for compilation warning positions.
https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-02/msg00031.html

When I try to install packages from the Package Menu or the command of
package-install since about two weeks ago, it reports the error:

error in process sentinel: async-when-done: Invalid read syntax: "#<"
error in process sentinel: Invalid read syntax: "#<"

And it seems not preventing the installation process but stops the emacs
to compile the el files to elc.

Could you check whether the async-bytecomp-package-mode is t or nil? My Emacs version is

In GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32) of 2022-01-31 
Repository revision: 04f9c3b8df6afaf1e9de9f2a4478f63fd959bf09

If sync-bytecomp-package-mode is t, then the error occurs when I call package-install or package-menu-mark-upgrades+package-menu-execute in the package-menu-mode (list-package).

It relates to some emacs' change around Jan 22.

I still see the problem. I think the symbols with positions change is the culprit, I see symbols with positions in the return value of async-inject-variables.

I asked for help in my bug report Bug#54079 regarding another issue related to this change (which had been fixed, but this one is still there):

https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-03/msg00571.html

I see symbols with positions in the binding of `byte-optimize--dynamic-vars' after I have byte compiled something (i.e., compiled normally, not asynchronously), and that seems to be the root cause of the issue. I have opened a separate Emacs bug#54433: 29.0.50; Invalid read syntax: "#<" with async-bytecomp. Let's see what comes out of this.

Yes, seems to help indeed, thanks. I hope not transferring those variables doesn't cause other issues.

After having a look at (info "(elisp) Symbols with Position"), you should be able to print the variable bindings using print-symbols-bare -> t to get rid of the symbol positions in printed expressions. You want to bind that in `async--insert-sexp' I think.

Good - thanks. Then let's hope that this fixes all of the trouble...

It works now.