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: Re: Buliding with tree-sitter (Was: Turing on tree-sitter) Date: Mon, 10 Oct 2022 23:34:25 +0200 Message-ID: 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> <1628c32e-9e0e-f208-a611-0a765fd322e9@secure.kjonigsen.net> Reply-To: jostein@kjonigsen.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------FDR0KjGp2n604PyGVmaQYyUP" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29027"; 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 23:35: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 1oi0R3-00077v-2M for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 23:35:42 +0200 Original-Received: from localhost ([::1]:59584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi0R1-0005rJ-TC for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 17:35:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi0Q5-00056J-Qf for emacs-devel@gnu.org; Mon, 10 Oct 2022 17:34:41 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:50033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi0Q0-000429-Co; Mon, 10 Oct 2022 17:34:40 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 61F3D5C013E; Mon, 10 Oct 2022 17:34:28 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 10 Oct 2022 17:34:28 -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= 1665437668; x=1665524068; bh=zW/MCMNkNyHZ9aTiZAc/Y5lZZN1rbkIDIxP 7Gk/YPRs=; b=Z4uOWli5HJp67gtzBZbVPS0uPHtNlqfW6SyDSmVjCoO9HGCxVpX mCg8ZEDzYCpiMgYLLJuINLjGkaEn9SP8q1luW0mu15rYMt0HQ93bBvW2WWLsW0o/ 9SiL7EHeklfRML72zPyMyfxLVJkpXJQhdSJls9alaZwMVielX6uyHlrqy/ghd5sr yBjncSEmiusjNvXZcwTX+p4QeXMzByao3mhWSOEBJGim/6qGcogjkpQNqv/TpRF7 Ewl+mi7EuMmrlfmwwhDob2P0U0XnJsJKynElwZ6Y1cj0fMFlonGrbqFNwfbwciQh P6FoFfQ+nzWpq4maXDipfX0ZaBjaHt9AIaw== 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=1665437668; x=1665524068; bh=zW/MCMNkNyHZ9 aTiZAc/Y5lZZN1rbkIDIxP7Gk/YPRs=; b=O+z1M2QsqwNqQIjdmZNEUXKwrJhAZ gTqTKf8qD2Yd4e/GZvEx8lcY97D1j1LHIDgOSsX59kvcq2/FWYXBPuOpER8aazAd /cVYY9xOlW0UPd9mdBxBI7b2h1AaN3JQRPAirqJJXJyxb7Pi530GchPxioSA5ibO 0N10jsMQetCe6MubvEZUHXxl5cnlTrQ2UUzAMOvLKUXC1jfCovojxn4CjkSoeJzg ILJG9mHLuWKldQDN/W2/ztsrW1/d4qLeTfqWzBIql9snn+HgIJrD8TFy2KddKc+k c1v1hBVBamp+mmDxhz03PqgM4Wm67ArwqnuVNaG9SZbuPESiI0tVsxaJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejgedgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtkfffgggfrhfuhffvvehfjgesrgdtreertdefjeenucfhrhhomheplfho shhtvghinhgpmfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjoh hnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepjeevledtheehudevheeghfej ueejhfefkeelkefgleegffffteekieeugefgtdevnecuffhomhgrihhnpehgihhthhhusg drtghomhdpkhhjnhhighhsvghnrdhnohenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhnihhgsh gvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 Oct 2022 17:34:27 -0400 (EDT) Content-Language: nb-NO In-Reply-To: <1628c32e-9e0e-f208-a611-0a765fd322e9@secure.kjonigsen.net> Received-SPF: pass client-ip=66.111.4.26; envelope-from=jostein@secure.kjonigsen.net; helo=out2-smtp.messagingengine.com X-Spam_score_int: -46 X-Spam_score: -4.7 X-Spam_bar: ---- X-Spam_report: (-4.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, NICE_REPLY_A=-2.007, 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:297402 Archived-At: This is a multi-part message in MIME format. --------------FDR0KjGp2n604PyGVmaQYyUP Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit It seems I need to inspect my build-environment better. I built Emacs and the tree-sitter libraries on different hosts without noticing... Building on same host and build completes fine now. Sorry abut the noise. :) -- Jostein On 10.10.2022 22:56, Jostein Kjønigsen wrote: > > 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 -- Vennlig hilsen *Jostein Kjønigsen* jostein@kjonigsen.net 🍵 jostein@gmail.com https://jostein.kjønigsen.no --------------FDR0KjGp2n604PyGVmaQYyUP Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

It seems I need to inspect my build-environment better.

I built Emacs and the tree-sitter libraries on different hosts without noticing... Building on same host and build completes fine now.

Sorry abut the noise. :)

--
Jostein

On 10.10.2022 22:56, Jostein Kjønigsen wrote:

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!

--------------FDR0KjGp2n604PyGVmaQYyUP--