From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sIrIBosHKmKqeQEAgWs5BA (envelope-from ) for ; Thu, 10 Mar 2022 15:13:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0NpaO4oHKmJNeAEAG6o9tA (envelope-from ) for ; Thu, 10 Mar 2022 15:13:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7A5AAB466 for ; Thu, 10 Mar 2022 15:13:30 +0100 (CET) Received: from localhost ([::1]:33002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSJXl-0002gr-2p for larch@yhetil.org; Thu, 10 Mar 2022 09:13:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSJ99-0001LG-6C for guix-patches@gnu.org; Thu, 10 Mar 2022 08:48:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSJ98-0008Lo-TO for guix-patches@gnu.org; Thu, 10 Mar 2022 08:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nSJ98-0003QQ-IB for guix-patches@gnu.org; Thu, 10 Mar 2022 08:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49946] [WIP PATCH v3 00/26] gnu: Add tree-sitter for emacs (and neovim as well?). Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Mar 2022 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49946 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Pierre Langlois , 49946@debbugs.gnu.org, Luis Henrique Gomes Higino Received: via spool by 49946-submit@debbugs.gnu.org id=B49946.164692007613152 (code B ref 49946); Thu, 10 Mar 2022 13:48:02 +0000 Received: (at 49946) by debbugs.gnu.org; 10 Mar 2022 13:47:56 +0000 Received: from localhost ([127.0.0.1]:33586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSJ92-0003Q2-F2 for submit@debbugs.gnu.org; Thu, 10 Mar 2022 08:47:56 -0500 Received: from mout.gmx.net ([212.227.15.19]:35835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nSJ90-0003PN-In for 49946@debbugs.gnu.org; Thu, 10 Mar 2022 08:47:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1646920067; bh=y+NeC/h3PGrfCDfSmVwO60bAhrByP0oapAV09iRI2Eo=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:Date:In-reply-to; b=YeCy8XIIM+JF80Dx277r96FBlRG4LXEwszcN4Te2wBT5yNKak1pplX9/XLBWL15fH s2wvbybDQBeRzQJa7P8VQf4b0Ur9/piG16GLuGodV6OYKlCLwBtAVCwMDxEol17Hbv DfoWmCWgbmPy0+gXS/7fUmD+AtiY2/t23OW7tWW0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1Ml6qM-1nrn4h0T9A-00lRpk; Thu, 10 Mar 2022 14:47:47 +0100 References: <87h7fztt60.fsf@gmx.com> <20210808233354.6745-1-pierre.langlois@gmx.com> <20210808233354.6745-7-pierre.langlois@gmx.com> <87czpwzg9e.fsf@gmx.com> <87leyinxly.fsf@gmx.com> <87lexl1goc.fsf@gmail.com> <87sfrrnpme.fsf@gmx.com> <24f64e912876f56fe40fbaeaec02ddd5e8ef2c4b.camel@telenet.be> <87zglykpmf.fsf@gmx.com> User-agent: mu4e 1.6.10; emacs 27.2 From: Pierre Langlois Date: Thu, 10 Mar 2022 13:19:34 +0000 In-reply-to: Message-ID: <87fsnpkjgg.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Provags-ID: V03:K1:7ZvbScERjRvM7EjFIQJx4FabrpX6qTwYT5PwtEp+qulLqjdH3e7 qTvqgqs6wnnxQa2lQSTmZn4ZZ7vcw8irmUkD6hB2a+AmAJISWhBGG1++pCC5btHGJkjCKqR UB66BcchjmhCLJ2aJfb5CEvPkOmBarxunMwvOrybggFTLoEtvVQnBZ6g2uYf/P26DTpEd/Y GOs09Xvpru0oAeTxauySw== X-UI-Out-Filterresults: notjunk:1;V03:K0:jtq2Vs+MA9U=:arZyxUV/PXwJ1AvSuZMP4r bRTgplKNgI8SptGwwh3bxzuUu8KdRUVA2IouT3SKXOEjOJUPSm7a1BU+RTTOniIm17Wa81llQ crvVvZk3a2ICdOj3zwt3evWjs8z16tEIAe73rYsqpINPLIiuwj81Rk50kGqTILO6r8hXC1hiw 3BjK7/FRBj+Url/IdMPmTnsLr4nR3EAy1Ejnhj8tPUEteU8AakL8MNwrSoDkyjRyfthARf6Og +LZW3voHHO+XXRALpkw86o7YYyaHQtphePIsJGYoaWJhsT7YG47NAevrzpaF5Ifsh9mqIIaLN mGYhszr2OXmYUzHkbQ0HTNgVPRh+uKmM01GxZHLzhLslP9lSJsob0DiIk/dzT+LiQkmJschxt DNXTrXI5E8t7jbbv9FxBUkaYTE9lDkFvsvy5Cq+uz8KV+TxKF20tgFe7jyVvMAIaqZ7ZH70TU RO91x78fPsmegkpcVn/jjiQn/WwMtu7bOCijfEgiCB0/MN9i2nMHiiRhqIk5To9wASa6DQ96Z 4lvqyxKE+GKu4x89XKfjJttfb4wbGFG2leBCAs+B9BWxv02lvzT5EpIy0PpwXd5ka8NOeesIr yWAoxAvBoBm3pjHHkVZYZRVtcHhvkLeSq/Bqe8BnZKtc1hrAhd9jGM1r3sHcxq5kZWa3rNn5z knjCPtzVHQ9bfRZQbXo/gE87/TsLA4Uzj34S2cRcsRqFEgMkMTqh9PDzp/A9BqZB8nifEH72N BcpxclXYacWaEWFrEIlgmGur2dE+muT6iO/lyVTt593fTBLK/EIRyyRtVllu2UsC0PSg6+YzT ZV0edBnj9yatW/ri9qbdPuEuyhPAa0hxHG0Ofc6+Ohox0V9KQRUFL0k3+uBqZN7uX/KsNyBHi nO8pY0/KCMaBfHWKpcFeBn0EeU7UaphR4TERQGYjkz7e2ZYy8VDOk9C9M7eVL5Uu9UgMTH+aW 53Aih21PcPrtYHQTbowSs7o46COUTqTgJEznbkCkoaCVjlKaerq0FlkAHsb5oTR7vxhw21+/R n7uF7gT//wmhCxaUwikdrHuLHE/PnJeY60y7HdrbEPC1N+VR7aZlay+vN86wuUkeuAh2kWwHJ YLQR1+b5exLi+c= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646921610; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=kava6dDkagYwV5bfUr+I9hRYTZBdKhVOfUNILzgTQWU=; b=uRTfhk9S0vvePgNLoQ+ugy8rJa3s2chXx6adQgM1ccHh2yMzvVhZC+6pocQcXLFL+x11tm /B9emUidpJ48N2nvSjOKzAaHsnq7niw6B9elZZwKKBdeT/HLqGz8N4XaFF1C8yy1PLAXo+ 7p3dQZjd9yHA2J49s3TsA9hufYKSjj7LePZ27Dzh4eipiTVXSRAb0sHEIGiGIxdV9ZHVXG gW2E1455ubQ4QOw5uxKOfHLl+izOAXQ8C03xMwOMnN3lbM84Q0As+IhJO0bQJq1ys7dRKk GAqmrzstKWGUoaqLK8xvWEWTIIqYzztFMdEeB5SEIqsULgRgMQUzxL7/LPrk3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646921610; a=rsa-sha256; cv=none; b=gAgigLtwE3uqIQeQwN1OfQ1pWRFwC2mVo3qVeyTxfmRa5MNZh/EHpvtJZLT1DqFWV9eASm zUm50xk9ZZ5cJXKNDD5EJ7j3dCqXj/YzmfpMhg2Nd41WLki1zyJffyNPd93v3G5s4seQWW SIuZtfHpd2FLi2aR0RTMjy7cQPJtZfyf3m6SvLZZL5Z7zzuUGi3VaJbuKPk4tw0l7OvUuV 32LJprjIIE+l//5gRigdrFdxKfVtsBusV6oCJP2FCSQJ76/VvoP3Xl1vHGVLMnANWO3NR8 9234oc/Ux//1mJt6LZEFeXlnmOeS8I9QUSBz2KfgDRvS/nKflb0jO6BIJdlD9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=YeCy8XII; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=YeCy8XII; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 7A5AAB466 X-Spam-Score: 3.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: YsIpFvDlJW65 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Maxime Devos writes: > [[PGP Signed Part:Undecided]] > Pierre Langlois schreef op do 10-03-2022 om 11:17 [+0000]: >> Before continuing to work on this build-system though, do you have >> any >> opinions about adding it to begin with?=C2=A0 As opposed to the current >> approach of defining a base grammar package (see tree-sitter-c) and >> have >> the other grammar packages inherit from it.=C2=A0 I'm wondering if it's >> worth >> adding the build-system, when I don't think we should expect the >> number >> of grammars we would package to grow too much.=C2=A0 But then again, the >> package definitions do look quite a bit nicer with the build-system, >> so >> I'm a bit on the fence about this :-). > > Build systems=C2=A0only cost a module or two, there are quite a few tree > sitter packages (19 or so?) and the tree sitter packages have a lot > in common (custom test phases, install phases), so I wouldn't > hesitate to define a custom build system for tree-sitter stuff. Sounds good, I'll continue in that direction for v5. > > Even better would be to unify things a bit more, e.g. it looks like > tree-sitter-ocaml needs a custom 'install', 'build' and 'check' phase, > but they looks almost the same as the other phases for other treesitter > packages, so maybe 'tree-sitter-build-system' can be taught to mostly > automatically determine the exact invocation?=20=20 I'll see what can be done, sadly so far I couldn't find a way to do the right thing automatically for ocaml and typescript. These are packages that provide two grammars, and I didn't see a way to "discover" that there are multiple languages supported. However maybe they could be split into multiple package definitions, if I can find a way to do that, maybe by passing new #:keyword parameters. Another idea could be to call back into the build-system phase, for example something like: =2D-8<---------------cut here---------------start------------->8--- (replace 'build (lambda _ (for-each (lambda (dir) (with-directory-excursion dir ((assoc-ref tree-sitter:%standard-phases 'build)))) '("ocaml" "interface")))) =2D-8<---------------cut here---------------end--------------->8--- I don't know if that works yet, we could do that if other nicer approaches don't work. > > Also, 'use-modules' only really works on the top-level, I recommend > #:modules instead, there are some problems with using it in expression > context (I don't think they are documented anywhere though). Ah, I see I had (use-modules (guix build json) (ice-9 regex)) in the install phase for no reason indeed, those modules were already imported, that's what you meant right? Thanks for your input! I'll work on a v5. Pierre --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmIqAX8YHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31URewH/iJ1rOj+497/oN1u3QAH0R+r 6scDBDANzi195NONgoOeI7POyRYh22LE1d5mFwgGqIWaNl6NYJhQD1i+aKYSk/8n VhfvuaSM2KXNf8BX5BS0NXwJSAt/7qg5R9Q9ZqVNYQdx5pjRbwGg8KaQiAd5LYKE 40NdqyszEBIaPMyoaLVRFQfLk+C91b4aTspCWHldawHys6klG+deePUpzBb3fGVX Auw5wPszK+1E4eXKp0ATA1x6qt2hO/9gAKj2DVWyqfuDfp4BFtcPFvmGZROCvtis lpEhEmYQQJhVLmyZmzlhIn+3zYzAOuoGHOSwsJSusnVYXTd5AABd125jeG62ED4= =sie6 -----END PGP SIGNATURE----- --=-=-=--