From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= Newsgroups: gmane.emacs.devel Subject: Buliding with tree-sitter (Was: Turing on tree-sitter) Date: Mon, 10 Oct 2022 22:56:22 +0200 Message-ID: <1628c32e-9e0e-f208-a611-0a765fd322e9@secure.kjonigsen.net> References: <83czb1jrm3.fsf@gnu.org> <87v8ot2nfi.fsf@posteo.net> <837d19jfia.fsf@gnu.org> <83edvgi3mx.fsf@gnu.org> <87r0zg5g76.fsf@thornhill.no> <78205E8D-B2D4-4460-BE0A-9BF7C627A79B@gmail.com> <87zge4b0lc.fsf@posteo.net> <83zge4gk9z.fsf@gnu.org> <434B99AD-F307-492A-8E9A-27C84CC575B0@gmail.com> <875ygrabpm.fsf@posteo.net> <29BCEC0D-8172-4DDB-ABC0-98F58971027A@gmail.com> Reply-To: jostein@kjonigsen.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------Q7rBulILjUG871cQVFfXnjPW" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40475"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Cc: Stefan Monnier , Eli Zaretskii , emacs-devel@gnu.org To: Theodor Thornhill , Yuan Fu , Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 10 22:57:43 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohzqH-000A9U-2R for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 22:57:43 +0200 Original-Received: from localhost ([::1]:49522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohzqF-00022I-Qt for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 16:57:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohzpF-0001Jg-2p for emacs-devel@gnu.org; Mon, 10 Oct 2022 16:56:37 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:60465) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohzp7-0005Uc-F9; Mon, 10 Oct 2022 16:56:36 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EAF055C00D3; Mon, 10 Oct 2022 16:56:26 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 10 Oct 2022 16:56:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to; s=fm2; t= 1665435386; x=1665521786; bh=LhvNoZ88l9KUulDoCtiAD6PuIRh/dtEf6xI 61+ep3E4=; b=KnWfk0nx/jENpOhK/KoBOF8h9wFI6umtzhNaernLX3sxcRwa4SM O03XY/2RBsZsg2X7qMRhPNY9zdjVe/Mzn0m1iy8zXDGXKu2dffEmuJKKDb+7y2da V5+5TVzhVxn35aqvAb57uPYSF+a6ygEfFqG4OmhSNIkMvufieubwHJpqKh7Hgkx/ z6f3EDzw1WgzdzGknpt6DkmxFwHl/B2YaTWUXb0gWjBc3KnPtrnbe8XDnrOu3ZOK fH5VZlwl0XAfoABfl5O1voHlRKESZ1PyAxOCENETLkv/kJuGj2LBUj1+oXrxuyo5 JRu3yvQEeFOUbZ8xtUMauNCTvL2GsKhoxPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1665435386; x=1665521786; bh=LhvNoZ88l9KUu lDoCtiAD6PuIRh/dtEf6xI61+ep3E4=; b=ErLzUnkzNK3gnadfO6Q3NWRfKpGV+ OoQEpN0Dp27Z+XcIr9QUt2AC8rOcZAxB8APFELQK1QcPDbDv8hsMmjQ9vCdx0Zp9 BKWtpDXJS8nj3938oEoYEtyDZpCJSopL7C06O56bhH3p28nkxQaJInyrhc1v4+9Y 4dce3Q2AQHzz93M7iaX2Y/WhNGcmP5VZqPX5qsCgBiU1s4iGRDilDsWUMJc2rPA8 m1J5fatNyFcRyPTuJWdyaT0wSBbCg5/VECPe4UdLHpUm6f5CyRjPSYCBiogDRv+8 siI2U8ex5D3+4EKJ952oY+b2uAlwpiG6X4Pob4E/gGS4nJvb3+xjGGnow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejgedgudegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfrhfuvfevfhfhjgesrgdtreertdefjeenucfhrhhomheplfho shhtvghinhgpmfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjoh hnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepjedtuefhgfdtiedvteehjeef udfgfffgveethedtvedvheetfeegleefveeguefgnecuffhomhgrihhnpehgihhthhhusg drtghomhdpkhhjnhhighhsvghnrdhnohenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgsh gvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Oct 2022 16:56:25 -0400 (EDT) Content-Language: nb-NO In-Reply-To: Received-SPF: pass client-ip=66.111.4.26; envelope-from=jostein@secure.kjonigsen.net; helo=out2-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297401 Archived-At: This is a multi-part message in MIME format. --------------Q7rBulILjUG871cQVFfXnjPW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hey everyone. I'm observing this recent activity on this branch with great enthusiasm. I've recently been trying Emacs from feature/tree-sitter with tree-sitter enabled, but using third-party major modes (co-developed by me and Theodor Thornhill). So far that has worked out OK for me. While seeing more and more modes getting tree-sitter support main-lined is great, I'm having trouble just building emacs now, and all major-modes using tree-sitter breaks the build, complaining about missing shared libraries. The command I'm using to build is: git clean -fdx && make distclean && ./configure --with-tree-sitter ; make -j6 One example error (but I get these for all modes, until I revert them back to their initial version from git-master): > textmodes/mhtml-mode.el:29:2: Error: Cannot load language definition: "javascript", ("/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript: cannot open shared object file: No such file or directory" "/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript.so: cannot open shared object file: No such file or directory" "libtree-sitter-javascript: cannot open shared object file: No such file or directory" "libtree-sitter-javascript.so: cannot open shared object file: No such file or directory") What I don't get about that error-message is that those files have been built and deployed, using https://github.com/casouri/tree-sitter-module. jostein@dev-jostein:~/.emacs.d/tree-sitter$ ls -l total 9828 -rwxrwxr-x 1 jostein jostein 2299312 okt.  10 22:12 libtree-sitter-cpp.so -rwxrwxr-x 1 jostein jostein 4035232 okt.  10 22:12 libtree-sitter-c-sharp.so -rwxrwxr-x 1 jostein jostein  400968 okt.  10 22:12 libtree-sitter-c.so -rwxrwxr-x 1 jostein jostein   78280 okt.  10 22:12 libtree-sitter-css.so -rwxrwxr-x 1 jostein jostein  241448 okt.  10 22:12 libtree-sitter-go.so -rwxrwxr-x 1 jostein jostein  165584 okt.  10 22:12 libtree-sitter-html.so -rwxrwxr-x 1 jostein jostein  353536 okt.  10 22:12 libtree-sitter-javascript.so -rwxrwxr-x 1 jostein jostein   15904 okt.  10 22:12 libtree-sitter-json.so -rwxrwxr-x 1 jostein jostein  446224 okt.  10 22:12 libtree-sitter-python.so -rwxrwxr-x 1 jostein jostein  934912 okt.  10 22:12 libtree-sitter-rust.so -rwxrwxr-x 1 jostein jostein 1070296 mai    9 12:14 libtree-sitter-tsx.so So what am I doing wrong? How should I build this? Any help would be appreciated. If I can build it, I can help test-drive and possible also provide patches, but for now I'm stuck. -- Jostein On 10.10.2022 19:05, Theodor Thornhill wrote: > > >> My bad, I thought Theodor was saying he would add separate major modes alongside non-tree-sitter major modes for the same language. Reading his message I think he is only adding the tree-sitter powered mode into core and leaving the non-tree-sitter version out. >> >> So IIUC we will have (a) major modes that supports both tree-sitter and non-tree-sitter, and (b) major modes that require tree-sitter to work. >> >> Again, a M-x treesit-enable in a mode that requires tree-sitter to work doesn’t make much sense. I think having individual major-mode level toggle variables and a global toggle variable is conceptually more fit? >> > Agreed! > -- Vennlig hilsen *Jostein Kjønigsen* jostein@kjonigsen.net 🍵 jostein@gmail.com https://jostein.kjønigsen.no --------------Q7rBulILjUG871cQVFfXnjPW Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hey everyone.

I'm observing this recent activity on this branch with great enthusiasm.

I've recently been trying Emacs from feature/tree-sitter with tree-sitter enabled, but using third-party major modes (co-developed by me and Theodor Thornhill). So far that has worked out OK for me.

While seeing more and more modes getting tree-sitter support main-lined is great, I'm having trouble just building emacs now, and all major-modes using tree-sitter breaks the build, complaining about missing shared libraries.

The command I'm using to build is:

git clean -fdx && make distclean && ./configure --with-tree-sitter ; make -j6

One example error (but I get these for all modes, until I revert them back to their initial version from git-master):

> textmodes/mhtml-mode.el:29:2: Error: Cannot load language definition: "javascript", ("/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript: cannot open shared object file: No such file or directory" "/home/jostein/.emacs.d/tree-sitter/libtree-sitter-javascript.so: cannot open shared object file: No such file or directory" "libtree-sitter-javascript: cannot open shared object file: No such file or directory" "libtree-sitter-javascript.so: cannot open shared object file: No such file or directory")

What I don't get about that error-message is that those files have been built and deployed, using https://github.com/casouri/tree-sitter-module.

jostein@dev-jostein:~/.emacs.d/tree-sitter$ ls -l
total 9828
-rwxrwxr-x 1 jostein jostein 2299312 okt.  10 22:12 libtree-sitter-cpp.so
-rwxrwxr-x 1 jostein jostein 4035232 okt.  10 22:12 libtree-sitter-c-sharp.so
-rwxrwxr-x 1 jostein jostein  400968 okt.  10 22:12 libtree-sitter-c.so
-rwxrwxr-x 1 jostein jostein   78280 okt.  10 22:12 libtree-sitter-css.so
-rwxrwxr-x 1 jostein jostein  241448 okt.  10 22:12 libtree-sitter-go.so
-rwxrwxr-x 1 jostein jostein  165584 okt.  10 22:12 libtree-sitter-html.so
-rwxrwxr-x 1 jostein jostein  353536 okt.  10 22:12 libtree-sitter-javascript.so
-rwxrwxr-x 1 jostein jostein   15904 okt.  10 22:12 libtree-sitter-json.so
-rwxrwxr-x 1 jostein jostein  446224 okt.  10 22:12 libtree-sitter-python.so
-rwxrwxr-x 1 jostein jostein  934912 okt.  10 22:12 libtree-sitter-rust.so
-rwxrwxr-x 1 jostein jostein 1070296 mai    9 12:14 libtree-sitter-tsx.so

So what am I doing wrong? How should I build this?

Any help would be appreciated. If I can build it, I can help test-drive and possible also provide patches, but for now I'm stuck.

--
Jostein


On 10.10.2022 19:05, Theodor Thornhill wrote:


My bad, I thought Theodor was saying he would add separate major modes alongside non-tree-sitter major modes for the same language. Reading his message I think he is only adding the tree-sitter powered mode into core and leaving the non-tree-sitter version out.

So IIUC we will have (a) major modes that supports both tree-sitter and non-tree-sitter, and (b) major modes that require tree-sitter to work.

Again, a M-x treesit-enable in a mode that requires tree-sitter to work doesn’t make much sense. I think having individual major-mode level toggle variables and a global toggle variable is conceptually more fit?

Agreed!

--------------Q7rBulILjUG871cQVFfXnjPW--