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?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Sat, 14 May 2022 20:50:39 +0200 Message-ID: References: <9E6D13F6-7E50-44EE-A357-C971A11A3636@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30167"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) Cc: Emacs Devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 14 20:52:09 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 1npws2-0007a0-9O for ged-emacs-devel@m.gmane-mx.org; Sat, 14 May 2022 20:52:08 +0200 Original-Received: from localhost ([::1]:33642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npws0-0006Gb-QT for ged-emacs-devel@m.gmane-mx.org; Sat, 14 May 2022 14:52:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npwqr-0005Ro-Eo for emacs-devel@gnu.org; Sat, 14 May 2022 14:50:53 -0400 Original-Received: from sonic314-20.consmr.mail.ir2.yahoo.com ([77.238.177.146]:33026) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npwqm-0007CT-Pr for emacs-devel@gnu.org; Sat, 14 May 2022 14:50:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1652554244; bh=g0UIkxDkD5L+w7IesoICDkDmfzlDQZhsOUGCm47OGSk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=rlZfTEPV7OW/Pu3U/+zqIZdqOnB4iAgwyKQJ9FcmIUSl7RFGzmhRKGIONVkE0dbyH5qU73WYbMrUVlUY+o0VNVoBDNaioQ7EzOO8TcpHN1wxrXYPddQ9wfnR90ieCBO2HjCJCWDHS4yZhK1vPVF9PXLU7g5m59wP1lwIKPfhAkCRJYmWgfxks6OFgj7kozALz+NTv3Mtxrn8TDVIJqSmXXNCxVEdqHJ0A4vBuphUlNl5TsxRJdIJ6R4/5dK+gtRmYS8VM824Os4HB2g1AEd6CJKW8YyBXB4WYWTWFPZD/KaXYVoJnjWfmBQMoP0/FNJOXrBWrgekjsTSSelYNAp42g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1652554244; bh=osTZdDu4LANBfyX7sumhjSk+KEdueKU68HDKnYFgsI+=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=NHZcqi1CNfIsnsgxOUtnU5YxGELIA3MMhUaKl6Sta+UYD927xFd8jpUv9dQ6lk9Fz2kJ21q6Ew4zQ+6gg2JNIKmQ1WmqzFNJ/yWUfEpKvG5pl/h1AsI6iYpQqMtUsTTUXL2QFFoD1a0Av2SmAZQZcGJeIlntHZHMihe6Cu1FYZ2N7fT0qFfds2AlZPzJRCvymXVcnrC3T1Md1XPrMdkyQD/0EK9r6Y0eN4LH85oubxp3+PKlbV6io8NYLRag/rQ6Fcvci4hgIAVdsGL9/cwbjs618AhqApSl5Qt0IRbr/MpD0PgjLakvcCrooq+yTmk9rAfJMtRgfrJv8hJEgqQAPQ== X-YMail-OSG: Rqt3XYEVM1n2Y.H2t.5JXnF0EqiYlxi9hUdf5Tb2SmtFo0KB5DYxGC8TKEjc4ZC yk.vWf86RIXGnlrlLFhQrLs7MaB73Q0cxVJ3jFp8TOvhTGuxGAEeVIqgM1.KJgWzsmhruUnN8DTN k9.jizULVNJdbyihV8Q3nO4idpWcnWKRTDVP_0f7zWKgchkvSJe3X8.IjNrgsnkLCRhTf_s8KFsF C.0s_dUUGAtLGGa9b8msXxyxvAsff3Gsl6UmVzhMT13c3MjC0z.SPrRtQHx9mMmPt9ZKuOQRpEtm B01xqGBJYnTKXb326BagDeD_Gf9yxL9FKmSrRi5pJh3BJHXo1uCFHgtod59TK79r16y0sV0v9Kor 8K5i2BGaaWKQKvDmJ7GAM8dbbniR0t3W8wHF7A9EmTNah1PmgLy2bGE5GpC8uu1TPeCezLhLuEEa Gnm25XzNHiKfN8ocp6nCAEvxmtMaNL_pLM3e7Kl6PGLMGYYR5olVKrDrOLCBP5NbjE5.vrq0UeCd Mfg3E5DcbqZqwbZE8sjfj.2fHEPymPnC3bZkwYbP9POKTibPf.J_u74lxNFxTJNolvGtiy6tjUqI RQJLodU9V5g4WeCrlUt3tWfF_w5pq2Zd7BlvopQ71PHAu0azfN4yS4ZtPvkgsZtbN30_soqmKZQ_ whg8SwAJW57TR2xCdFa54bl3KzS6SXJ03v5Q9ElIhIPD9_PfaSNUiV8zoiDD.mLWJfVrLmmgcE.c xQky7OjS11NwdexOKYrBfkffJHtRuhBEg0zGO7YYKUjbJscN1.Tw1m3D1Kff_pGC6JUyxIWNhCEd d7h9_.WthOO5v7jc1V9_68VV9ehLxm48yQYAoVt9oJ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ir2.yahoo.com with HTTP; Sat, 14 May 2022 18:50:44 +0000 Original-Received: by hermes--canary-production-ir2-695448f88c-c29cs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 119fcc8bb0b3f2a0bbd8038d27dd95ad; Sat, 14 May 2022 18:50:40 +0000 (UTC) In-Reply-To: (Yuan Fu's message of "Sat, 14 May 2022 08:55:31 -0700") X-Mailer: WebService/1.1.20188 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.177.146; envelope-from=mardani29@yahoo.es; helo=sonic314-20.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:289782 Archived-At: Yuan Fu writes: >>=20 >> Thanks for working on this. What is the best way to report >> problems/contribute patches?=20=20 > > Thanks, you can just send a patch to me or open a report on debbugs and s= end a patch there. > Thanks, I'll send patches to Debbugs from now on. > >> I've tried to build the branch and got a >> "file not found" error when including (I have >> tree-sitter correctly installed via Homebrew on macOS). I've fixed the >> problem with the following patch: >>=20 >> diff --git a/configure.ac b/configure.ac >> index bf97dd017c..5a82d47db3 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -3115,7 +3115,6 @@ AC_DEFUN >> [HAVE_TREE_SITTER=3Dyes], [HAVE_TREE_SITTER=3Dno]) >> if test "${HAVE_TREE_SITTER}" =3D yes; then >> AC_DEFINE(HAVE_TREE_SITTER, 1, [Define if using tree-sitter.]) >> - TREE_SITTER_LIBS=3D-ltree-sitter >> TREE_SITTER_OBJ=3D"treesit.o" >> fi >> fi > > Could you explain a bit why removing this line works for you? And what sp= ecific problem are you solving? I=E2=80=99m not so savvy in autotools. > The problem I tried to solve was this linker error: ld: library not found for -ltree-sitter The reason is that the custom library directory on my system, /opt/homebrew/Cellar/, needs to be set via -L, but setting TREE_SITTER_LIBS overrided that. Pkg-config already provides the necessary linker flags to use the library. With my change, I get the following in config.log: TREE_SITTER_LIBS=3D'-L/opt/homebrew/Cellar/tree-sitter/0.20.6/lib -ltree-si= tter' which is similar, for example, to how Jansson is linked: JSON_LIBS=3D'-L/opt/homebrew/Cellar/jansson/2.14/lib -ljansson' and all compiles and links successfully. N.B: I don't know if this would work on MS-Windows. Perhaps MS-Windows loads tree-sitter dynamically and will need a special case that just unsets TREE_SITTER_LIBS.