Subject: Re: bug#62875: 28.2; Crash on MacOS/M1 with treesitter enabled

From: Ruijie Yu <[email-masked]>
Date: Sun, 16 Apr 2023 12:51:53 +0800

CC'ing Yuan, who is deeply involved in integrating tree-sitter into
Emacs.

Drew Moseley <[email-masked]> writes:

> Start with 'emacs -Q' on MacOS with an M1 chip.  I specifically used the
> prebuilt binaries from https://emacsformacosx.com/builds.  I could
> reproduce this with the latest stable release, as well as with
> Emacs-pretest-29.0.90-universal and a nightly with version 30.0.50.
>
> Load the following elisp code:
>
>    (require 'package)
>    (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
>    (package-refresh-contents)
>    (package-initialize)
>    (package-install 'tree-sitter)
>    (global-tree-sitter-mode)

> In GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559))
> of 2023-02-22 built on armbob.lan
> Windowing system distributor 'Apple', version 10.3.2299
> System Description:  macOS 13.3.1
>
> Configured using:
> 'configure --with-ns '--enable-locallisppath=/Library/Application
> Support/Emacs/${version}/site-lisp:/Library/Application
> Support/Emacs/site-lisp' --with-modules --with-x-toolkit=no'
>
> Configured features:
> ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER THREADS
> TOOLKIT_SCROLL_BARS ZLIB

It seems to me that you are trying to install "tree-sitter" from Melpa
with Emacs >= 29?  If that is your intention, please note that there is
now builtin support for tree-sitter in Emacs >= 29, and that Melpa
"tree-sitter" is therefore not compatible with Emacs >= 29.

Although, please take that with a grain of salt, because I noticed that
tree-sitter is not mentioned in configure, nor the configured features.
If I'm not mistaken, tree-sitter feature is automatically enabled when
the executable "tree-sitter" is found.  Did you install it from your
package manager like brew?

Maybe try to "configure" with --with-tree-sitter and report back what
happens?  And also please show what "which tree-sitter" returns on your
system.

-- 
Best,

RY